feat: add Header component with blur effect feat: first steps into dark- and light-mode support
16 lines
471 B
TypeScript
16 lines
471 B
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { usePathname } from "next/navigation";
|
|
import { ReactNode } from "react";
|
|
|
|
export default function NavItem({ path, children }: { path: string; children: ReactNode }) {
|
|
const pathname = usePathname();
|
|
const isActive = pathname === path;
|
|
|
|
return (
|
|
<Link href={path} className={`px-3 py-1 rounded-full hover:bg-blue-300 ${isActive ? "underline" : ""}`}>
|
|
{children}
|
|
</Link>
|
|
);
|
|
} |