/* MEXYFOR — Contact (お問い合わせ) Page Design Comp / Plan A direction */ const ContactComp = () => { const T = window.TOKENS; const initialForm = { inquiryType: '事業・サービスに関するお問い合わせ', name: '', company: '', email: '', message: '', privacyAgreed: false, }; const [formData, setFormData] = React.useState(initialForm); const [status, setStatus] = React.useState('idle'); // idle | sending | success | error const update = (key) => (e) => setFormData((p) => ({ ...p, [key]: e.target.value })); const ENDPOINT = 'https://script.google.com/macros/s/AKfycbxNs1sey8O6Y4PkIxH7nvio78v0SOael3Zb4lbVB1w97uwVuMxN6e9jCJOD3Rn8Dm-w/exec'; const handleSubmit = async (e) => { e.preventDefault(); if (status === 'sending') return; if (!formData.privacyAgreed) { alert('プライバシーポリシーへの同意が必要です。'); return; } setStatus('sending'); try { const res = await fetch(ENDPOINT, { method: 'POST', body: JSON.stringify({ inquiryType: formData.inquiryType, name: formData.name, company: formData.company, email: formData.email, message: formData.message || '記載なし', }), }); const data = await res.json().catch(() => ({})); console.log('[Contact] response:', res.status, data); if (!res.ok || data.success !== true) { throw new Error(data.error || `HTTP ${res.status}`); } setStatus('success'); setFormData(initialForm); } catch (err) { console.error('[Contact] submission failed:', err); setStatus('error'); } }; const wrap = { width: '100%', maxWidth: 1440, margin: '0 auto', background: T.paper, color: T.ink, fontFamily: T.sans, }; const lbl = { fontFamily: T.mono, fontSize: 10, letterSpacing: '0.28em', color: T.ink3, textTransform: 'uppercase' }; const fieldLabel = { fontFamily: T.mono, fontSize: 11, letterSpacing: '0.18em', color: T.ink3, textTransform: 'uppercase' }; const fieldInput = { width: '100%', padding: '14px 0', fontSize: 16, fontFamily: T.serif, color: T.ink, background: 'transparent', border: 'none', borderBottom: `1px solid ${T.rule}`, outline: 'none', boxSizing: 'border-box', }; return (