website/app/components/Navbar.tsx

48 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2023-12-03 23:02:09 +07:00
"use client"
import Link from "next/link"
import React, {useState} from "react"
import { FaBars, FaTimes } from "react-icons/fa"
const Navbar = () => {
const [nav, setNav] = useState(false);
const links = [
{
id: 1,
text: "Home",
link: "/"
},
{
id: 2,
text: "Projects",
link: "projects"
},
{
2024-05-03 10:41:57 +07:00
id: 3,
2023-12-03 23:02:09 +07:00
text: "Hobbies",
link: "hobbies"
2024-09-18 18:29:17 +07:00
},
{
id: 4,
text: "Donate",
link: "donate"
2023-12-03 23:02:09 +07:00
}
];
return (
<div className="flex justify-between items-center h-20 nav lg:-ml-[15px]">
<ul className="flex">
{links.map(({ id, text, link }) => (
<li
key={id}
2023-12-22 23:31:58 +07:00
className="nav-links px-4 cursor-pointer capitalize font-medium text-lg max-sm:text-base text-gray-500 hover:scale-105 hover:text-black dark:hover:text-white duration-200 link-underline"
2023-12-03 23:02:09 +07:00
>
<Link href={link}>{text}</Link>
</li>
))}
</ul>
</div>
);
}
export default Navbar;