fixing build error - not everything can be nice

This commit is contained in:
Ivan Dimitrov 2023-11-11 19:58:35 +02:00
parent 53907ea9e1
commit 40c1d0b0a2

View File

@ -2,21 +2,25 @@
import Link from "next/link"; import Link from "next/link";
import { usePathname } from "next/navigation"; import { usePathname } from "next/navigation";
const link = (text: string, href: string) => { const Navbar = () => {
const path = usePathname() const path = usePathname()
const link = (text: string, href: string) => {
return (
<Link data-selected={path === href} className="btn" aria-label={text} href={href}>
{text}
</Link>
)
}
return ( return (
<Link data-selected={path === href} className="btn" aria-label={text} href={href}> <div className="w-max h-max px-6 py-2 mx-auto rounded-full bg-slate-900 grid place-content-center">
{text} <div className="flex flex-row gap-6">
</Link> {link("Home", "/")}
{link("Cases", "/cases")}
{link("Contact", "/contact")}
</div>
</div>
) )
} }
const Navbar = () =>
<div className="w-max h-max px-6 py-2 mx-auto rounded-full bg-slate-900 grid place-content-center">
<div className="flex flex-row gap-6">
{link("Home", "/")}
{link("Cases", "/cases")}
{link("Contact", "/contact")}
</div>
</div>
export default Navbar export default Navbar