/**
 * 견적 등록 페이지
 */

"use client";

import { useRouter } from "next/navigation";
import { QuoteRegistration, QuoteFormData } from "@/components/quotes/QuoteRegistration";
import { toast } from "sonner";

export default function QuoteNewPage() {
  const router = useRouter();

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

  const handleSave = async (formData: QuoteFormData) => {
    // TODO: API 연동
    console.log("견적 등록 데이터:", formData);

    // 임시: 성공 시뮬레이션
    await new Promise((resolve) => setTimeout(resolve, 500));

    toast.success("견적이 등록되었습니다. (API 연동 필요)");
  };

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