import { coverBackground } from "../../ui/constants.jsx"; import { I } from "../../ui/icons.jsx"; import { NotebookCover } from "../../ui/NotebookCover.jsx"; import { fmtDate } from "../../ui/format"; import { FONT_SERIF, FONT_UI } from "../../ui/theme"; const RECENT_COUNT = 6; /** Landing view: every notebook as a cover, plus the notes touched most recently. */ /** * The six most recently edited, whatever order the list arrives in. * * `activeNotes` carries whichever arrangement the notebook it came from was in — * a hand-made order, or a title sort — and under this heading that is simply the * wrong list: "Recent" is a question about time, and it must answer it even when * every notebook is arranged by hand. */ const byLastEdited = (notes, count) => [...notes].sort((a, b) => String(b.updatedAt || "").localeCompare(String(a.updatedAt || ""))).slice(0, count); export function Dashboard({ T, isMobile, notebooks, activeNotes, activeFolder, onToggleSidebar, onOpenNotebook, onOpenNote, onNewNotebook, onNotebookContextMenu, dnd, }) { const recentlyEdited = byLastEdited(activeNotes, RECENT_COUNT); return (