'use client';

import DentalRecordForm from '@/app/components/Patient/DentalRecordForm';
import { useParams, useRouter } from 'next/navigation';

export default function NewDentalRecordPage() {
    const router = useRouter();
    const params = useParams<{ id: string }>();

    const handleSuccess = () => {
        router.push(`/patients/${params.id}`);
    };

    const handleCancel = () => {
        router.back();
    };

    return (
        <div className="container mx-auto py-8">
            <DentalRecordForm
                patientId={params.id}
                onSuccess={handleSuccess}
                onCancel={handleCancel}
            />
        </div>
    );
}
