fix error for deployment on vercel
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import {useState} from "react";
|
||||
|
||||
export default function Contact() {
|
||||
const [form, setForm] = useState({ name: "", email: "", message: "" });
|
||||
const [form, setForm] = useState({name: "", email: "", message: ""});
|
||||
const [success, setSuccess] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
|
||||
const handleChange = (
|
||||
e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
|
||||
) => {
|
||||
setForm({ ...form, [e.target.name]: e.target.value });
|
||||
setForm({...form, [e.target.name]: e.target.value});
|
||||
};
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
@@ -20,10 +20,14 @@ export default function Contact() {
|
||||
// Simulate a successful submission
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
setSuccess(true);
|
||||
setForm({ name: "", email: "", message: "" });
|
||||
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 (
|
||||
|
||||
@@ -8,7 +8,7 @@ export default function NotFound() {
|
||||
404
|
||||
</h1>
|
||||
<p className="mt-4 text-xl text-gray-600 dark:text-gray-300">
|
||||
Oops! The page you're looking for doesn't exist.
|
||||
Oops! The page you're looking for doesn't exist.
|
||||
</p>
|
||||
<Link
|
||||
href="/"
|
||||
|
||||
Reference in New Issue
Block a user