'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 rounded-md p-1.5 text-start text-neutral-700 no-underline transition hover:bg-neutral-500/10 hover:no-underline', isActive && !isExpanded && 'bg-sky-500/10 text-sky-700' )} >
{organization.name}
{organization.name}
{routes.map((route) => ( ))}
); }; NavItem.Skeleton = function SkeletonNavItem() { return (
); };