'use client';

import { use } from 'react';
import { useSearchParams } from 'next/navigation';
import { LaborDetailClient } from '@/components/business/construction/labor-management';
import type { DetailMode } from '@/components/templates/IntegratedDetailTemplate';

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

export default function LaborDetailPage({ params }: LaborDetailPageProps) {
  const { id } = use(params);
  const searchParams = useSearchParams();
  const mode = searchParams.get('mode');
  const initialMode: DetailMode = mode === 'edit' ? 'edit' : 'view';

  return <LaborDetailClient laborId={id} initialMode={initialMode} />;
}