import { useState } from "react" const isDev = process.env.NODE_ENV !== 'production' export default function ContactPage({ analytics }: any) { const [done, setDone] = useState(false) const [error, setError] = useState(null) const [email, setEmail] = useState("") const [message, setMessage] = useState("") const [nameOfPerson, setName] = useState("") const onSubmit = (e: any) => { analytics.contactPage(email) if(isDev) { // dev mode dosent have php backend so i have to run it do ABSOULTLEY NOTHING! // just pretend it works console.log(` To: ${nameOfPerson} (${email}) ${message} `) if(Math.random() > .5) { setDone(true) } else { setError(`Math.random was NOT higher then .5`) } } else { const form = new FormData(e.target) fetch('/contact_form.php', { body: form, method: "POST" }).then(e => { return e.text() }).then(text => { if(text == "OK") { setDone (true) } else { setError (text as string) } }) } } const ui = (f: any) => (e: any) => f(e.target.value) return

Contact Form

{/*

Provident cupiditate voluptatem et in. Quaerat fugiat ut assumenda excepturi exercitationem quasi. In deleniti eaque aut repudiandae et a id nisi.

*/} {(error || done) ? : } {/* */}
} export function FormResults({ error, email, done } : { error: string | null, email: string, done: Boolean }) { if(done) return

Thank you for your message! you will eventually recive a response at {email}

if(error) { return

{error}

} return

idk

} export function ContactForm({ onSubmit, nameOfPerson, message, email, uiE,uiN,uiM }: any) { return

}