Skip to content
Source
Sign inSign up
fuko/trytanstackdb-v2
Open History to see the last commit

editor.tsx

28 lines943 Bytes

1import type { Note } from "@/fixtures";
2import { formatEditorDate } from "@/lib/notes/dates";
3​
4import { NoteContent } from "../note-content";
5import { EditorToolbar } from "./editor-toolbar";
6​
7export function MacEditor({ note }: { note: Note | undefined }) {
8 return (
9 <section aria-label="Editor" className="flex min-w-0 flex-1 flex-col bg-mac-content">
10 <EditorToolbar />
11 <div
12 data-page-scroll
13 className="notes-scroll min-h-0 flex-1 overflow-y-auto px-[22px] pb-10 text-mac-text"
14 >
15 {note ? (
16 <>
17 <p className="pt-1 pb-3 text-center text-[12px] text-mac-text-secondary">
18 {formatEditorDate(new Date(note.updatedAt))}
19 </p>
20 <NoteContent note={note} variant="mac" />
21 </>
22 ) : (
23 <p className="pt-32 text-center text-[13px] text-mac-text-secondary">No note selected</p>
24 )}
25 </div>
26 </section>
27 );