"use client"; import Link from "next/link"; import * as React from "react"; import { Separator } from "@/components/ui/separator"; import { cn } from "@/lib/utils"; import { useRouter, useSelectedLayoutSegment } from "next/navigation"; type Props = { navigation: { label: string; href: string; segment: string | null; tag?: string }[]; className?: string; }; export const Navbar: React.FC> = ({ navigation, className }) => { return ( ); }; const NavItem: React.FC = ({ label, href, segment, tag }) => { const selectedSegment = useSelectedLayoutSegment(); const [isPending, startTransition] = React.useTransition(); const router = useRouter(); const active = segment === selectedSegment; return (
  • startTransition(() => { router.push(href); }) } className={cn( "text-sm flex items-center gap-1 font-medium py-2 px-3 -mx-3 text-content-subtle hover:bg-background-subtle rounded-md hover:text-primary", { "text-primary": active, }, )} > {label} {tag ? (
    {tag}
    ) : null}
  • ); };