'use client';

/**
 * 계좌 등록 페이지 - IntegratedDetailTemplate 적용
 */

import { IntegratedDetailTemplate } from '@/components/templates/IntegratedDetailTemplate';
import { accountConfig } from '@/components/settings/AccountManagement/accountConfig';
import { createBankAccount } from '@/components/settings/AccountManagement/actions';
import type { AccountFormData } from '@/components/settings/AccountManagement/types';

export default function NewAccountPage() {
  const handleSubmit = async (data: Record<string, unknown>) => {
    const result = await createBankAccount(data as AccountFormData);
    return { success: result.success, error: result.error };
  };

  return (
    <IntegratedDetailTemplate
      config={accountConfig}
      mode="create"
      onSubmit={handleSubmit}
      stickyButtons={true}
    />
  );
}
