/**
 * 거래처 등록 페이지
 */

"use client";

import { useRouter } from "next/navigation";
import { ClientRegistration } from "@/components/clients/ClientRegistration";
import { useClientList, ClientFormData } from "@/hooks/useClientList";

export default function ClientNewPage() {
  const router = useRouter();
  const { createClient, isLoading } = useClientList();

  const handleBack = () => {
    router.push("/sales/client-management-sales-admin");
  };

  const handleSave = async (formData: ClientFormData) => {
    await createClient(formData);
  };

  return (
    <ClientRegistration
      onBack={handleBack}
      onSave={handleSave}
      isLoading={isLoading}
    />
  );
}