import React from 'react' import { Edit, Trash2, PanelLeftClose, PanelLeftOpen, SquarePen } from 'lucide-react' import ModelSelector from './ModelSelector' import { McpServers } from './McpServers' import { type Model } from '../types/models' import { type Message } from '../types' import { type Tool } from 'use-mcp/react' interface Conversation { id?: number title: string messages: Message[] } interface ChatSidebarProps { sidebarVisible: boolean setSidebarVisible: React.Dispatch> conversations: Conversation[] conversationId: number | undefined setConversationId: React.Dispatch> deleteConversation: (id: number) => void editConversationTitle: (id: number, newTitle: string) => void startNewConversation: () => void selectedModel: Model onModelChange: (model: Model) => void apiKeyUpdateTrigger: number onMcpToolsUpdate: (tools: Tool[]) => void mcpTools: Tool[] } const ChatSidebar: React.FC = ({ sidebarVisible, setSidebarVisible, conversations, conversationId, setConversationId, deleteConversation, editConversationTitle, startNewConversation, selectedModel, onModelChange, apiKeyUpdateTrigger, onMcpToolsUpdate, mcpTools, }) => { const handleConversationClick = (id: number | undefined) => { setConversationId(id) if (window.matchMedia('(max-width: 768px)').matches) { setSidebarVisible(false) } } return ( <> {/* Mobile overlay */} {sidebarVisible &&
setSidebarVisible(false)} />}
    {conversations.map((conversation) => (
  • handleConversationClick(conversation.id)} >
    {conversation.title}
  • ))}
{/* Model Selector and MCP Servers at bottom */}
0} />
) } export default ChatSidebar