mirror of
https://github.com/TheRealOwenRees/chess-scribe-website.git
synced 2026-07-23 09:56:57 +00:00
rudimentary contact form boilerplate
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user