import { useState } from 'react'; import { SectionWrapper } from '../components/SectionWrapper'; const CONTACT_API_URL = import.meta.env.VITE_CONTACT_API_URL || 'https://shsf-api.reversed.dev/api/exec/17/cba6645c-2ca2-4e7a-ad94-e6114cbde761'; const socialLinks = [ { name: 'Email', url: 'mailto:space@reversed.dev', icon: '📧', desc: 'space@reversed.dev' }, { name: 'GitHub / Gitea', url: 'https://gitea.reversed.dev/luna', icon: '⌨️', desc: 'gitea.reversed.dev/luna' }, ]; const initialForm = { username: '', email: '', message: '', }; export function Contact() { const [form, setForm] = useState(initialForm); const [status, setStatus] = useState({ type: '', message: '' }); const [isSubmitting, setIsSubmitting] = useState(false); const handleChange = (event) => { const { name, value } = event.target; setForm((current) => ({ ...current, [name]: value })); }; const handleSubmit = async (event) => { event.preventDefault(); setIsSubmitting(true); setStatus({ type: '', message: '' }); try { const response = await fetch(CONTACT_API_URL, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(form), }); const data = await response.json().catch(() => ({})); const payload = data?._res && typeof data._res === 'object' ? data._res : data; if (!response.ok) { throw new Error(payload?.error || payload?.message || 'Something went wrong while sending the message.'); } setStatus({ type: 'success', message: payload?.message || 'Message received. A reply might take a bit, but it made it through.', }); setForm(initialForm); } catch (error) { setStatus({ type: 'error', message: error.message || 'Something went wrong while sending the message.', }); } finally { setIsSubmitting(false); } }; return (

Get in Touch

Send a message directly from the site, or use one of the links below.

Contact form

Messages go straight into the inbox backend. No weird third-party form service nonsense.