'use client';

import { useParams } from 'next/navigation';
import { AccountDetail } from '@/components/settings/AccountManagement/AccountDetail';
import type { Account } from '@/components/settings/AccountManagement/types';

// Mock 데이터 (API 연동 전 임시)
const mockAccounts: Account[] = [
  {
    id: 'account-1',
    bankCode: 'shinhan',
    accountNumber: '1234-1234-1234-1234',
    accountName: '운영계좌 1',
    accountHolder: '예금주1',
    status: 'active',
    createdAt: '2025-12-19T00:00:00.000Z',
    updatedAt: '2025-12-19T00:00:00.000Z',
  },
  {
    id: 'account-2',
    bankCode: 'kb',
    accountNumber: '1234-1234-1234-1235',
    accountName: '운영계좌 2',
    accountHolder: '예금주2',
    status: 'inactive',
    createdAt: '2025-12-19T00:00:00.000Z',
    updatedAt: '2025-12-19T00:00:00.000Z',
  },
  {
    id: 'account-3',
    bankCode: 'woori',
    accountNumber: '1234-1234-1234-1236',
    accountName: '운영계좌 3',
    accountHolder: '예금주3',
    status: 'active',
    createdAt: '2025-12-19T00:00:00.000Z',
    updatedAt: '2025-12-19T00:00:00.000Z',
  },
  {
    id: 'account-4',
    bankCode: 'hana',
    accountNumber: '1234-1234-1234-1237',
    accountName: '운영계좌 4',
    accountHolder: '예금주4',
    status: 'inactive',
    createdAt: '2025-12-19T00:00:00.000Z',
    updatedAt: '2025-12-19T00:00:00.000Z',
  },
  {
    id: 'account-5',
    bankCode: 'nh',
    accountNumber: '1234-1234-1234-1238',
    accountName: '운영계좌 5',
    accountHolder: '예금주5',
    status: 'active',
    createdAt: '2025-12-19T00:00:00.000Z',
    updatedAt: '2025-12-19T00:00:00.000Z',
  },
  {
    id: 'account-6',
    bankCode: 'ibk',
    accountNumber: '1234-1234-1234-1239',
    accountName: '운영계좌 6',
    accountHolder: '예금주6',
    status: 'inactive',
    createdAt: '2025-12-19T00:00:00.000Z',
    updatedAt: '2025-12-19T00:00:00.000Z',
  },
  {
    id: 'account-7',
    bankCode: 'shinhan',
    accountNumber: '1234-1234-1234-1240',
    accountName: '운영계좌 7',
    accountHolder: '예금주7',
    status: 'active',
    createdAt: '2025-12-19T00:00:00.000Z',
    updatedAt: '2025-12-19T00:00:00.000Z',
  },
  {
    id: 'account-8',
    bankCode: 'kb',
    accountNumber: '1234-1234-1234-1241',
    accountName: '운영계좌 8',
    accountHolder: '예금주8',
    status: 'inactive',
    createdAt: '2025-12-19T00:00:00.000Z',
    updatedAt: '2025-12-19T00:00:00.000Z',
  },
  {
    id: 'account-9',
    bankCode: 'woori',
    accountNumber: '1234-1234-1234-1242',
    accountName: '운영계좌 9',
    accountHolder: '예금주9',
    status: 'active',
    createdAt: '2025-12-19T00:00:00.000Z',
    updatedAt: '2025-12-19T00:00:00.000Z',
  },
  {
    id: 'account-10',
    bankCode: 'hana',
    accountNumber: '1234-1234-1234-1243',
    accountName: '운영계좌 10',
    accountHolder: '예금주10',
    status: 'inactive',
    createdAt: '2025-12-19T00:00:00.000Z',
    updatedAt: '2025-12-19T00:00:00.000Z',
  },
];

export default function AccountDetailPage() {
  const params = useParams();
  const accountId = params.id as string;

  // Mock: 계좌 조회
  const account = mockAccounts.find(a => a.id === accountId);

  if (!account) {
    return (
      <div className="p-6">
        <div className="text-center py-8 text-muted-foreground">
          계좌를 찾을 수 없습니다.
        </div>
      </div>
    );
  }

  return <AccountDetail account={account} mode="view" />;
}