'use client';

/**
 * 단가 상세/수정 페이지 (Client Component)
 * V2 패턴: ?mode=edit로 수정 모드 전환
 */

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

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

export default function PricingDetailPage({ params }: PageProps) {
  const { id } = use(params);
  const searchParams = useSearchParams();
  const mode = searchParams.get('mode') === 'edit' ? 'edit' : 'view';

  return <PricingDetailClient pricingId={id} initialMode={mode} />;
}