"use client"; import Image from "next/image"; import { Activity, CreditCard, Layout, Settings } from "lucide-react"; import { usePathname, useRouter } from "next/navigation"; import { AccordionContent, AccordionItem, AccordionTrigger, } from "@/components/ui/accordion"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { Skeleton } from "@/components/ui/skeleton"; export type Organization = { id: string; slug: string; imageUrl: string; name: string; }; interface NavItemsProps { isExpanded: boolean; isActive: boolean; organization: Organization; onExpand: (id: string) => void; } export const NavItem = ({ isExpanded, isActive, organization, onExpand, }: NavItemsProps) => { const router = useRouter(); const pathname = usePathname(); const routes = [ { label: "Boards", icon: , href: `/organization/${organization.id}`, }, { label: "Activity", icon: , href: `/organization/${organization.id}/activity`, }, { label: "Settings", icon: , href: `/organization/${organization.id}/settings`, }, { label: "Billing", icon: , href: `/organization/${organization.id}/billing`, }, ]; const onClick = (href: string) => { router.push(href); }; return ( onExpand(organization.id)} className={cn( "flex items-center gap-x-2 p-1.5 text-neutral-700 rounded-md hover:bg-neutral-500/10 transition text-start no-underline hover:no-underline", isActive && !isExpanded && "bg-sky-500/10 text-sky-700" )} >
{organization.name}
{organization.name}
{routes.map((route) => ( ))}
); }; NavItem.Skeleton = function SkeletonNavItem() { return (
); };