/** * Chat Toolbar * Session selector, new session, refresh, and thinking toggle. * Rendered in the Header when on the Chat page. */ import { RefreshCw, Brain, ChevronDown, Plus } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'; import { useChatStore } from '@/stores/chat'; import { cn } from '@/lib/utils'; import { useTranslation } from 'react-i18next'; export function ChatToolbar() { const sessions = useChatStore((s) => s.sessions); const currentSessionKey = useChatStore((s) => s.currentSessionKey); const switchSession = useChatStore((s) => s.switchSession); const newSession = useChatStore((s) => s.newSession); const refresh = useChatStore((s) => s.refresh); const loading = useChatStore((s) => s.loading); const showThinking = useChatStore((s) => s.showThinking); const toggleThinking = useChatStore((s) => s.toggleThinking); const { t } = useTranslation('chat'); const handleSessionChange = (e: React.ChangeEvent) => { switchSession(e.target.value); }; return (
{/* Session Selector */}
{/* New Session */}

{t('toolbar.newSession')}

{/* Refresh */}

{t('toolbar.refresh')}

{/* Thinking Toggle */}

{showThinking ? t('toolbar.hideThinking') : t('toolbar.showThinking')}

); }