rudimentary contact form boilerplate

This commit is contained in:
2026-06-03 22:21:11 +02:00
parent af6809874c
commit 38fc389776
5 changed files with 118 additions and 7 deletions
+25
View File
@@ -0,0 +1,25 @@
import Contact from "#/pages/Contact/Contact.tsx";
const ContactContainer = () => {
const handleSubmit = async (_prevState: unknown, data: FormData) => {
const name = data.get("name");
const email = data.get("email");
const subject = data.get("subject");
const message = data.get("message");
try {
return { success: true, message: "Message sent!" };
} catch (error) {
// TODO logger
console.error("Error sending message:", error);
return {
success: false,
message: "Failed to send message. Please try again.",
};
}
};
return <Contact handleSubmit={handleSubmit} />;
};
export default ContactContainer;