import React from 'react'; import type { ChatSession } from '../types'; import { NEW_CHAT_ID } from '../constants'; import { XIcon } from './icons'; // Added XIcon interface SidebarProps { chats: ChatSession[]; activeChatId: string | null; onSelectChat: (chatId: string) => void; onCreateNewChat: () => void; isOpen: boolean; onClose: () => void; } export const Sidebar: React.FC = ({ chats, activeChatId, onSelectChat, onCreateNewChat, isOpen, onClose }) => { const sortedChats = [...chats].sort((a, b) => b.createdAt - a.createdAt); const handleChange = (event: React.ChangeEvent) => { const selectedValue = event.target.value; if (selectedValue === NEW_CHAT_ID) { onCreateNewChat(); } else { onSelectChat(selectedValue); } }; return (

Chats

); };