diff --git a/app/components/Contact.tsx b/app/components/Contact.tsx index e2f11b2..5041f54 100644 --- a/app/components/Contact.tsx +++ b/app/components/Contact.tsx @@ -1,77 +1,81 @@ "use client"; -import { useState } from "react"; +import {useState} from "react"; export default function Contact() { - const [form, setForm] = useState({ name: "", email: "", message: "" }); - const [success, setSuccess] = useState(false); - const [error, setError] = useState(""); + const [form, setForm] = useState({name: "", email: "", message: ""}); + const [success, setSuccess] = useState(false); + const [error, setError] = useState(""); - const handleChange = ( - e: React.ChangeEvent, - ) => { - setForm({ ...form, [e.target.name]: e.target.value }); - }; + const handleChange = ( + e: React.ChangeEvent, + ) => { + setForm({...form, [e.target.name]: e.target.value}); + }; - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - // Replace this with actual form submission logic (e.g., API call) - try { - // Simulate a successful submission - await new Promise((resolve) => setTimeout(resolve, 1000)); - setSuccess(true); - setForm({ name: "", email: "", message: "" }); - } catch (err) { - setError("Failed to send message. Please try again."); - } - }; + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + // Replace this with actual form submission logic (e.g., API call) + try { + // Simulate a successful submission + await new Promise((resolve) => setTimeout(resolve, 1000)); + setSuccess(true); + setForm({name: "", email: "", message: ""}); + } catch (err) { + //use err to avoid unused variable warning + if (err instanceof Error) { + setError("Failed to send message. Please try again."); + } - return ( -
-

- Contact Me -

-
- {success && ( -

- Your message has been sent successfully! -

- )} - {error &&

{error}

} - - - - -
-
- ); + } + }; + + return ( +
+

+ Contact Me +

+
+ {success && ( +

+ Your message has been sent successfully! +

+ )} + {error &&

{error}

} + + + + +
+
+ ); } diff --git a/app/not-found.tsx b/app/not-found.tsx index 450624c..81b9575 100644 --- a/app/not-found.tsx +++ b/app/not-found.tsx @@ -1,22 +1,22 @@ import Link from "next/link"; export default function NotFound() { - return ( -
-
-

- 404 -

-

- Oops! The page you're looking for doesn't exist. -

- - Go Back Home - -
-
- ); + return ( +
+
+

+ 404 +

+

+ Oops! The page you're looking for doesn't exist. +

+ + Go Back Home + +
+
+ ); }