"use client";
import type { CloudThread } from "@assistant-ui/cloud-ai-sdk";
import { cn } from "@/lib/utils";
import { Plus, Trash2, MessageSquare } from "lucide-react";
type ThreadListProps = {
threads: CloudThread[];
selectedId: string | null;
onSelect: (id: string | null) => void;
onDelete: (id: string) => void;
isLoading: boolean;
};
export function ThreadList({
threads,
selectedId,
onSelect,
onDelete,
isLoading,
}: ThreadListProps) {
return (
{isLoading && threads.length === 0 ? (
Loading...
) : threads.length === 0 ? (
) : (
{threads.map((thread) => (
))}
)}
);
}