import { I } from "../../ui/icons.jsx"; import { BackButton } from "../../ui/BackButton.jsx"; import { FONT_SERIF, FONT_UI } from "../../ui/theme"; import { NoteEditor } from "./NoteEditor.jsx"; const toolbarButton = (T, color) => ({ display: "flex", alignItems: "center", justifyContent: "center", width: 30, height: 30, borderRadius: 8, border: "none", background: "transparent", cursor: "pointer", color, }); /** Shown on desktop when nothing is selected; on a phone the list fills the screen instead. */ function EmptyState({ T, isTrashView, onCreateNote }) { return (
✏️
Select a note to edit
{!isTrashView && ( )}
); } /** A trashed note can be read and restored, but not edited. */ function TrashedNote({ T, isMobile, note, onBack, onRestore, onPermanentDelete }) { return (
{isMobile && } {note.title}
Trashed notes are read-only. Restore to edit.
); } /** * The right-hand pane: title bar plus the rich-text editor. * * `restoreEpoch` is part of the editor's key so that restoring an old version * remounts it on the restored body instead of trying to merge into the live * document. */ export function EditorPane({ T, dark, isMobile, note, isTrashView, restoreEpoch, backlinks, linkProps, onBack, onUpdate, onToggleStar, onTrash, onRestore, onPermanentDelete, onOpenHistory, onCreateNote, }) { if (!note) return isMobile ? null : ; if (isTrashView) return ( ); return (
{isMobile && } onUpdate({ title: e.target.value })} style={{ flex: 1, border: "none", background: "transparent", outline: "none", fontSize: isMobile ? 15 : 17, fontWeight: 600, color: T.text, fontFamily: FONT_SERIF, minWidth: 0, }} />
); }