'use client';

import { useParams, useSearchParams } from 'next/navigation';
import { PurchaseDetail } from '@/components/accounting/PurchaseManagement/PurchaseDetail';

export default function PurchaseDetailPage() {
  const params = useParams();
  const searchParams = useSearchParams();
  const purchaseId = params.id as string;
  const mode = searchParams.get('mode') === 'edit' ? 'edit' : 'view';

  return <PurchaseDetail purchaseId={purchaseId} mode={mode} />;
}