/* global React, Icon */ // Form submits to a Google Apps Script Web App that appends a row // to the Dynawins leads Google Sheet. // // Setup: see google-apps-script.gs in this folder for the full guide. // Paste your deployed Web App URL into window.__DYNAWINS_FLOW_URL in index.html. const FLOW_URL = window.__DYNAWINS_FLOW_URL || ''; // empty = simulate locally const ContactPage = () => { const [form, setForm] = React.useState({ name: '', email: '', phone: '', product: 'Smart Panel AI', description: '' }); const [status, setStatus] = React.useState('idle'); // idle | sending | sent | error const [errMsg, setErrMsg] = React.useState(''); const upd = (k) => (e) => setForm({ ...form, [k]: e.target.value }); const submit = async (e) => { e.preventDefault(); setStatus('sending'); setErrMsg(''); const payload = { "Name": form.name, "Email": form.email, "Phone": form.phone, "Interested Product": form.product, "Description": form.description, // bonus: timestamp for the flow to write to a hidden col if you add one "SubmittedAt": new Date().toISOString(), }; try { if (!FLOW_URL) { // No URL configured — simulate so prototype still demos. await new Promise((r) => setTimeout(r, 800)); console.log('[Dynawins] Form payload (would POST to Google Sheets):', payload); setStatus('sent'); return; } // Apps Script Web Apps return a 302 redirect that browsers can't follow // with a POST + JSON body in CORS mode. Use no-cors: the request fires // and Google appends the row, but we get an opaque response. await fetch(FLOW_URL, { method: 'POST', mode: 'no-cors', headers: { 'Content-Type': 'text/plain;charset=utf-8' }, body: JSON.stringify(payload), }); console.log('[Dynawins] POST sent to Sheet (opaque response)'); setStatus('sent'); } catch (err) { setStatus('error'); setErrMsg(err.message || 'Something went wrong. Please email us instead.'); } }; return (
{/* HERO — split: text on left, image on right (image fills full hero height) */}
Contact

Talk to a maker, not a bot.

Tell us about your D365 setup and what you're trying to fix. We'll reply with a tailored demo and a sandbox link within one business day.

A working session inside a modern office { e.currentTarget.parentElement.style.display = 'none'; }} />
{/* CONTACT METHODS — three cards, horizontal */}
{/* FORM — centered, full-width inside a max-width column */}
Get a demo

Tell us what you're trying to fix.

Two minutes of typing. One business day to a sandbox link.

{status === 'sent' ? (

Got it — talk soon.

Your details are now a row in our leads workbook. We'll reply within one business day.

) : (
{status === 'error' && (
{errMsg}
)}
By submitting, you agree to our privacy policy. We'll never share your details.
)}
Submissions land in our Dynawins leads workbook. No third-party CRM, no forwarding, no leaks.
); }; const ContactCard = ({ iconName, label, value, href, hint }) => { const inner = ( <>
{label}
{value}
{hint &&
{hint}
} ); return href ? {inner} :
{inner}
; }; const Field = ({ label, placeholder, type = 'text', multiline = false, value, onChange, required }) => (
{multiline ?