1
0
Fork 0
This repository has been archived on 2023-12-03. You can view files and clone it, but cannot push or open issues or pull requests.
chellaris-galaxy-political-.../components/navbar.tsx

21 lines
581 B
TypeScript
Raw Normal View History

'use client';
import '@/app/globals.css'
import { usePathname } from 'next/navigation'
import Links from '@/public/routes.json'; // move to api again but use this for inital hydration
import Link from 'next/link';
export const PageNavbar = () => {
const path = usePathname();
let navbar: JSX.Element
navbar = (
<nav className='navbar'>
{Links.links.map((item) => (
<Link className={(path === item.href ? "active" : "")} key={item.name} href={item.href}>
{item.name}
</Link>
))}
</nav>
);
return navbar;
}