'use client';

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

import { use } from 'react';
import { useSearchParams } from 'next/navigation';
import WithdrawalDetailClientV2 from '@/components/accounting/WithdrawalManagement/WithdrawalDetailClientV2';

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

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

  return <WithdrawalDetailClientV2 withdrawalId={id} initialMode={mode} />;
}