'use client';

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

import { use } from 'react';
import { useSearchParams } from 'next/navigation';
import DepositDetailClientV2 from '@/components/accounting/DepositManagement/DepositDetailClientV2';

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

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

  return <DepositDetailClientV2 depositId={id} initialMode={mode} />;
}