/* VE GAMERZ — Contact (validation + inline errors + success + mailto + honeypot). */ const { Button, Eyebrow, Badge, Input, Textarea } = window.VEGAMERZDesignSystem_63bcb5; const CD = window.VG_DATA; const CS = window.VG; const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; function validate(f) { const e = {}; if (!f.name.trim()) e.name = 'Tell us your gamer tag or name.'; else if (f.name.trim().length < 2) e.name = 'That looks a little short.'; if (!f.email.trim()) e.email = 'We need an email to reply.'; else if (!EMAIL_RE.test(f.email.trim())) e.email = 'That email doesn\u2019t look right.'; if (!f.message.trim()) e.message = 'Drop us a message first.'; else if (f.message.trim().length < 10) e.message = 'A few more words, please (10+).'; return e; } function FieldError({ id, msg }) { if (!msg) return null; return ; } function ContactForm() { const [f, setF] = React.useState({ name: '', email: '', message: '', company: '' }); const [errors, setErrors] = React.useState({}); const [tried, setTried] = React.useState(false); const [sent, setSent] = React.useState(false); const set = (k) => (e) => { const v = e.target.value; const nf = { ...f, [k]: v }; setF(nf); if (tried) setErrors(validate(nf)); }; const mailtoHref = () => { const subject = encodeURIComponent('VE GAMERZ — Message from ' + (f.name.trim() || 'the site')); const body = encodeURIComponent((f.message || '') + '\n\n— ' + (f.name || '') + (f.email ? ' (' + f.email + ')' : '')); return 'mailto:' + CD.SITE.email + '?subject=' + subject + '&body=' + body; }; const onSubmit = (e) => { e.preventDefault(); setTried(true); const errs = validate(f); setErrors(errs); if (Object.keys(errs).length) { const first = document.getElementById('vg-' + Object.keys(errs)[0]); first && first.focus(); return; } if (f.company) return; /* honeypot tripped — silently drop */ setSent(true); }; if (sent) { return (

Message Locked In

Thanks, {f.name.trim().split(' ')[0] || 'gamer'} — the squad got it and we\u2019ll get back to you soon.

// Prefer email? Send it straight from your own mail app below.

); } return (