/* ============================================================ Enarge — お問い合わせ(1ページ統合・フォームのみ) Exposes window.ContactPage ============================================================ */ const { useState: useStateCT } = React; function CF_Field({ label, required, children, hint }) { return ( ); } /* 送信先アドレスはサーバ側(contact.php)にのみ記載。HTML には出さない。 */ const FORM_ENDPOINT = "contact.php"; const cfInput = { width: "100%", padding: "13px 15px", borderRadius: "var(--radius)", background: "var(--ink-900)", border: "1.5px solid var(--ink-500)", color: "var(--text-strong)", fontSize: 15.5, fontFamily: "var(--font-ui)", outline: "none", transition: "border .15s", boxSizing: "border-box" }; function ContactPage({ onLogin }) { const login = onLogin || (() => {}); const [sent, setSent] = useStateCT(false); const [busy, setBusy] = useStateCT(false); const [error, setError] = useStateCT(""); const [file, setFile] = useStateCT(""); const focus = e => e.target.style.borderColor = "var(--cream-300)"; const blur = e => e.target.style.borderColor = "var(--ink-500)"; async function submit(e) { e.preventDefault(); const form = e.target; if (form.website.value) return; // ハニーポット:ボットのみ入力する隠しフィールド setBusy(true); setError(""); try { const res = await fetch(FORM_ENDPOINT, { method: "POST", body: new FormData(form), headers: { Accept: "application/json" } }); const data = await res.json().catch(() => ({})); if (!res.ok || !data.ok) throw new Error(data.error || "送信に失敗しました"); form.reset(); setFile(""); setSent(true); } catch (err) { setError(err.message || "送信できませんでした。時間をおいて再度お試しください。"); } finally { setBusy(false); } } return (

お問い合わせ

{sent ?

送信しました

内容を確認のうえ、担当者よりご連絡いたします。

:
{error ?
{error}
: null}
}
); } window.ContactPage = ContactPage;