Files
personal-website/components/TabItem.tsx
2024-04-25 04:41:05 +02:00

17 lines
341 B
TypeScript

"use client";
import { usePathname } from "next/navigation";
export default async function TabItem({ targetPath, text }: { targetPath: string, text: string}) {
const currentPath = usePathname();
return (
<a
href={targetPath}
className={currentPath === targetPath ? "underline" : ""}
>
{text}
</a>
);
}