'use client';

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

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

export default function ConstructionManagementDetailPage({ params }: PageProps) {
  const { id } = use(params);
  const searchParams = useSearchParams();

  // V2 패턴: mode 체크
  const mode = searchParams.get('mode') || 'view';
  const isEditMode = mode === 'edit';

  return <ConstructionDetailClient id={id} mode={isEditMode ? 'edit' : 'view'} />;
}
