"use client"; import { Button } from "@/components/ui/button"; import { useChatContext } from "@/lib/store/ChatContext"; import { MessageSquare, PlusCircle, Trash2, XCircle } from "lucide-react"; import React from "react"; interface ConversationListProps { conversations: any[]; onNewConversation: () => void; onSelectConversation: (id: string) => void; onDeleteConversation: (id: string) => void; onDeleteAllConversations: () => void; } // A component that accepts props for backward compatibility const ConversationList: React.FC = ({ conversations, onNewConversation, onSelectConversation, onDeleteConversation, onDeleteAllConversations }) => { const handleSelectConversation = (id: string) => { onSelectConversation(id); }; return (
{conversations.length > 0 && ( )}

Recent Research

{conversations.length === 0 ? (

No conversations yet

) : ( conversations.map((conversation) => (
)) )}
); }; // A component that uses context directly export const ConversationListWithContext: React.FC = () => { const { conversations, newConversation, selectConversation, deleteConversation, deleteAllConversations } = useChatContext(); return ; }; export default ConversationList;