'use client'
import { cn } from '@/lib/utils'
import Link from 'next/link'
import { usePathname, useRouter } from 'next/navigation'
import { MessageCircleIcon, Trash2Icon, Loader2Icon } from 'lucide-react'
import { removeChat } from './actions'
import { useTransition } from 'react'
export function SidebarItem({
title,
href,
id,
userId
}: {
title: string
href: string
id: string
userId: string
}) {
const pathname = usePathname()
const router = useRouter()
const active = pathname === href
const [isPending, startTransition] = useTransition()
if (!id) return null
return (