"use client";
import { useState } from "react";

export default function PartnerInquiryPage() {
  const [form, setForm] = useState({ name: "", contact: "", category: "", message: "" });
  const [done, setDone] = useState(false);
  async function submit() {
    const r = await fetch("/api/partner-inquiries", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(form) });
    setDone(r.ok);
  }
  if (done) return <div>접수되었습니다. 검토 후 연락드리겠습니다.</div>;
  return (
    <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
      <h1>제휴 문의</h1>
      <input placeholder="업체명" value={form.name} onChange={(e) => setForm({ ...form, name: e.target.value })} />
      <input placeholder="연락처/이메일" value={form.contact} onChange={(e) => setForm({ ...form, contact: e.target.value })} />
      <input placeholder="카테고리(선택)" value={form.category} onChange={(e) => setForm({ ...form, category: e.target.value })} />
      <textarea placeholder="문의 내용" value={form.message} onChange={(e) => setForm({ ...form, message: e.target.value })} rows={8} />
      <button onClick={submit}>접수</button>
    </div>
  );
}


