"use client"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger, } from "@/components/ui/sheet"; import { CheckCircle, XCircle, Loader2, GitBranch, Layers3, Plus, Bug, } from "lucide-react"; import { useRouter } from "next/navigation"; import { ThreadDisplayInfo } from "./types"; import { ThreadCard } from "./thread-card"; interface ThreadSwitcherProps { currentThread: ThreadDisplayInfo; allThreads: ThreadDisplayInfo[]; } export function ThreadSwitcher({ currentThread, allThreads, }: ThreadSwitcherProps) { const [open, setOpen] = useState(false); const router = useRouter(); const otherThreads = allThreads.filter((t) => t.id !== currentThread.id); const runningCount = otherThreads.filter( (t) => t.status === "running", ).length; return ( All Threads
{/* New Chat Button */} {/* Current Thread */}

Current Thread

{/* Other Threads */} {otherThreads.length > 0 && (

Other Threads

{otherThreads.map((thread) => ( ))}
)}
); }