import clsx from 'clsx'; import React from 'react'; import { MdBookmarkBorder } from 'react-icons/md'; import { IoIosList } from 'react-icons/io'; import { PiNotePencil } from 'react-icons/pi'; import { LuMessageSquare } from 'react-icons/lu'; import { useEnv } from '@/context/EnvContext'; import { useTranslation } from '@/hooks/useTranslation'; import { useSettingsStore } from '@/store/settingsStore'; const TabNavigation: React.FC<{ activeTab: string; onTabChange: (tab: string) => void; }> = ({ activeTab, onTabChange }) => { const _ = useTranslation(); const { appService } = useEnv(); const { settings } = useSettingsStore(); const aiEnabled = settings?.aiSettings?.enabled ?? false; const tabs = ['toc', 'annotations', 'bookmarks', ...(aiEnabled ? ['history'] : [])]; const getTabLabel = (tab: string) => { switch (tab) { case 'toc': return _('TOC'); case 'annotations': return _('Annotate'); case 'bookmarks': return _('Bookmark'); case 'history': return _('Chat'); default: return ''; } }; return (
{tabs.map((tab) => (
onTabChange(tab)} onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onTabChange(tab); } }} title={getTabLabel(tab)} aria-label={getTabLabel(tab)} >
{tab === 'toc' ? ( ) : tab === 'annotations' ? ( ) : tab === 'bookmarks' ? ( ) : ( )}
))}
); }; export default TabNavigation;