import clsx from "clsx"; import { t } from "../../../i18n"; import { historyIcon, TrashIcon } from "../../icons"; import DropdownMenu from "../../dropdownMenu/DropdownMenu"; import { FilledButton } from "../../FilledButton"; import type { SavedChat } from "../types"; interface ChatHistoryMenuProps { isOpen: boolean; onToggle: () => void; onClose: () => void; onNewChat: () => void; onRestoreChat: (chat: SavedChat) => void; onDeleteChat: (chatId: string, event: React.MouseEvent) => void; savedChats: SavedChat[]; activeSessionId: string; disabled?: boolean; isNewChatBtnVisible?: boolean; } export const ChatHistoryMenu = ({ isOpen, onToggle, onClose, onNewChat, onRestoreChat, onDeleteChat, isNewChatBtnVisible, savedChats, activeSessionId, disabled, }: ChatHistoryMenuProps) => { return (
{isNewChatBtnVisible && ( {t("chat.newChat")} )} {savedChats.length > 0 && (
{historyIcon} <> {savedChats.map((chat) => ( { onRestoreChat(chat); }} > {chat.title} ))}
)}
); };