'use client';

import PrescriptionForm from '@/app/components/Prescription/PrescriptionForm';
import { useParams, useRouter } from 'next/navigation';

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

    return (
        <div className="container mx-auto py-8 max-w-3xl">
            <PrescriptionForm
                patientId={params.id}
                onSuccess={() => router.push(`/patients/${params.id}`)}
                onCancel={() => router.back()}
            />
        </div>
    );
}
