'use client';

import { use } from 'react';
import { useSearchParams } from 'next/navigation';
import { ReceivingDetail } from '@/components/material/ReceivingManagement';

interface Props {
  params: Promise<{ id: string }>;
}

export default function ReceivingDetailPage({ params }: Props) {
  const { id } = use(params);
  const searchParams = useSearchParams();
  const mode = (searchParams.get('mode') as 'view' | 'edit' | 'new') || 'view';

  return <ReceivingDetail id={id} mode={mode} />;
}