diff --git a/components/Home.jsx b/components/Home.jsx
index 8b82ea3..94bd22c 100644
--- a/components/Home.jsx
+++ b/components/Home.jsx
@@ -1,9 +1,8 @@
-"use client";
+'use client';
import { useState } from "react";
import { useRouter } from "next/navigation";
-import toast, { Toaster } from "react-hot-toast";
+import toast, { Toaster } from 'react-hot-toast';
import Typewriter from "typewriter-effect";
-import Link from "next/link";
function Home() {
const [username, setUsername] = useState("");
@@ -13,15 +12,15 @@ function Home() {
e.preventDefault();
if (username.trim()) {
try {
- const response = await fetch("/api/user", {
- method: "POST",
+ const response = await fetch('/api/user', {
+ method: 'POST',
headers: {
- "Content-Type": "application/json",
+ 'Content-Type': 'application/json',
},
body: JSON.stringify({ username: username.trim() }),
});
- console.log(response);
+ console.log(response)
if (response.ok) {
const data = await response.json();
@@ -29,16 +28,16 @@ function Home() {
if (data.exists) {
router.push(`/${username.trim()}`);
} else {
- toast.error("Username does not exist on GitHub");
+ toast.error('Username does not exist on GitHub');
}
} else {
- toast.error("Error verifying username. Please try again.");
+ toast.error('Error verifying username. Please try again.');
}
} catch (error) {
- toast.error("An unexpected error occurred. Please try again.");
+ toast.error('An unexpected error occurred. Please try again.');
}
} else {
- toast.error("Please enter a username.");
+ toast.error('Please enter a username.');
}
};
@@ -47,24 +46,11 @@ function Home() {