"use client"; import { useSidebarStore } from "@/lib/stores/sidebar-store"; import { cn } from "@/lib/utils"; export interface ChatListRowProps { label: string; type: "post" | "draft" | "channel" | "dm"; id: string; preview?: string; count?: number; selected?: boolean; onClick?: () => void; } export function ChatListRow({ label, type, id, preview, count, selected, onClick }: ChatListRowProps) { const rowClass = cn( "flex items-center py-1.5 px-3 border-b border-transparent hover:border-sidebar-border", "hover:bg-background/5 transition-colors", selected && "bg-accent text-accent-foreground", "cursor-pointer" ); const getIcon = () => { switch (type) { case "post": return ( ); case "draft": return ( ); case "channel": return ( ); case "dm": default: return ( ); } }; return (
{getIcon()}
{label} {preview && ( {preview} )}
{count !== undefined && count > 0 && ( {count} )}
); }