'use client' import Link from 'next/link' import { usePathname } from 'next/navigation' import { ChatListItem } from '@/lib/types' import { cn } from '@/lib/utils' import { buttonVariants } from '@/components/ui/button' import { IconMessage, IconUsers } from '@/components/ui/icons' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' interface SidebarItemProps { chat: ChatListItem children: React.ReactNode } export function SidebarItem({ chat, children }: SidebarItemProps) { const pathname = usePathname() const isActive = pathname === chat.path if (!chat?.id) return null return (
{chat.sharePath ? ( This is a shared chat. ) : ( )}
{chat.title}
{isActive &&
{children}
}
) }