import { useStore } from '../../store'; import { TiptapEditor } from './TiptapEditor'; import { MoreActions } from './MoreActions'; import { BookOpen } from 'lucide-react'; import type { SaveState } from '../../store'; function saveLabel(s: SaveState): string { if (s === 'saving') return '保存中…'; if (s === 'error') return '保存失败'; return '已保存'; } export function Editor() { const currentPath = useStore(s => s.currentPath); const title = useStore(s => s.title); const saveState = useStore(s => s.saveState); if (!currentPath) { // B档-8:空状态引导 return (