'use client';

import { use, useEffect } from 'react';
import { useRouter } from 'next/navigation';

interface HandoverReportEditPageProps {
  params: Promise<{
    id: string;
    locale: string;
  }>;
}

/**
 * V2 하위 호환성: /[id]/edit → /[id]?mode=edit 리다이렉트
 */
export default function HandoverReportEditPage({ params }: HandoverReportEditPageProps) {
  const { id } = use(params);
  const router = useRouter();

  useEffect(() => {
    router.replace(`/construction/project/contract/handover-report/${id}?mode=edit`);
  }, [id, router]);

  return (
    <div className="flex items-center justify-center min-h-[400px]">
      <div className="text-muted-foreground">리다이렉트 중...</div>
    </div>
  );
}
