import clsx from 'clsx'; import React from 'react'; import { PiNotePencil, PiRobot } from 'react-icons/pi'; import { useEnv } from '@/context/EnvContext'; import { useTranslation } from '@/hooks/useTranslation'; import { useSettingsStore } from '@/store/settingsStore'; import { NotebookTab } from '@/store/notebookStore'; interface NotebookTabNavigationProps { activeTab: NotebookTab; onTabChange: (tab: NotebookTab) => void; } const NotebookTabNavigation: React.FC = ({ activeTab, onTabChange, }) => { const _ = useTranslation(); const { appService } = useEnv(); const { settings } = useSettingsStore(); const aiEnabled = settings?.aiSettings?.enabled ?? false; const tabs: NotebookTab[] = aiEnabled ? ['notes', 'ai'] : []; const getTabLabel = (tab: NotebookTab) => { switch (tab) { case 'notes': return _('Notes'); case 'ai': return _('AI'); default: return ''; } }; const getTabIcon = (tab: NotebookTab) => { switch (tab) { case 'notes': return ; case 'ai': return ; default: return null; } }; 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)} >
{getTabIcon(tab)}
))}
); }; export default NotebookTabNavigation;