'use client';

import { use } from 'react';
import { useSearchParams } from 'next/navigation';
import { ItemDetailClient } from '@/components/business/construction/item-management';

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

export default function ItemDetailPage({ params }: ItemDetailPageProps) {
  const { id } = use(params);
  const searchParams = useSearchParams();
  const mode = searchParams.get('mode');
  const isEditMode = mode === 'edit';

  return <ItemDetailClient itemId={id} isEditMode={isEditMode} />;
}