Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- Call init_pain_storage() in Tauri .setup() so pain persistence activates on boot - Integrate useColdStart hook into FirstConversationPrompt for auto-greeting - Add UI mode toggle section to Settings/General (already had imports) - Add "简洁" mode switch-back button to TopBar in professional layout - Update SemanticSkillRouter @reserved annotation to reflect active status
64 lines
2.0 KiB
TypeScript
64 lines
2.0 KiB
TypeScript
import { ClipboardList, Minimize2 } from 'lucide-react';
|
|
import { Button } from './ui';
|
|
import { useUIModeStore } from '../store/uiModeStore';
|
|
|
|
interface TopBarProps {
|
|
title: string;
|
|
subtitle?: string;
|
|
onOpenDetail?: () => void;
|
|
showDetailButton?: boolean;
|
|
}
|
|
|
|
export function TopBar({
|
|
title,
|
|
subtitle,
|
|
onOpenDetail,
|
|
showDetailButton = true
|
|
}: TopBarProps) {
|
|
return (
|
|
<header className="h-14 bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700 flex items-center px-4 flex-shrink-0">
|
|
{/* 左侧标题 */}
|
|
<div className="flex items-center gap-2">
|
|
<div className="w-8 h-8 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-lg shadow-sm" />
|
|
<div>
|
|
<span className="font-bold text-lg text-gray-900 dark:text-gray-100">{title}</span>
|
|
{subtitle && (
|
|
<span className="ml-2 text-sm text-gray-500 dark:text-gray-400">{subtitle}</span>
|
|
)}
|
|
</div>
|
|
</div>
|
|
|
|
{/* 中间区域 */}
|
|
<div className="flex-1" />
|
|
|
|
{/* 右侧按钮 */}
|
|
<div className="flex items-center gap-1">
|
|
{/* 切换简洁模式 */}
|
|
<Button
|
|
variant="ghost"
|
|
size="sm"
|
|
onClick={() => useUIModeStore.getState().setMode('simple')}
|
|
className="flex items-center gap-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100"
|
|
title="切换到简洁模式"
|
|
>
|
|
<Minimize2 className="w-4 h-4" />
|
|
<span className="text-sm">简洁</span>
|
|
</Button>
|
|
{/* 详情按钮 */}
|
|
{showDetailButton && onOpenDetail && (
|
|
<Button
|
|
variant="ghost"
|
|
size="sm"
|
|
onClick={onOpenDetail}
|
|
className="flex items-center gap-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100"
|
|
title="显示详情面板"
|
|
>
|
|
<ClipboardList className="w-4 h-4" />
|
|
<span className="text-sm">详情</span>
|
|
</Button>
|
|
)}
|
|
</div>
|
|
</header>
|
|
);
|
|
}
|