import { COVERS, DEFAULT_FOLDERS } from "./constants.jsx"; import { I } from "./icons.jsx"; import { FONT_UI } from "./theme"; const SYNC_LABELS = { synced: "All synced", syncing: "Syncing...", offline: "Offline mode", pending: "Changes pending", }; const syncColor = (status, T) => { if (status === "synced") return T.success; if (status === "syncing" || status === "pending") return T.warning; if (status === "offline") return T.muted; return T.danger; }; const iconButton = (T) => ({ display: "flex", alignItems: "center", justifyContent: "center", width: 32, height: 32, borderRadius: 8, border: "none", background: "transparent", cursor: "pointer", color: T.muted, }); const folderButton = (T, active) => ({ display: "flex", alignItems: "center", gap: 10, width: "100%", padding: "8px 12px", borderRadius: 10, border: "none", cursor: "pointer", fontSize: 13, fontWeight: 500, textAlign: "left", background: active ? T.sidebarActive : "transparent", color: active ? T.accentText : T.textSec, }); const countBadge = (T, color) => ({ marginLeft: "auto", fontSize: 11, color, background: color === T.danger ? T.danger + "15" : T.accentSoft, padding: "2px 7px", borderRadius: 10, }); /** * Navigation rail: search, the built-in views, and the notebook list. * * On a phone it becomes a full-screen overlay; `onClose` is what the backdrop * and every navigation action call so it does not stay in the way. */ export function Sidebar({ T, dark, onToggleDark, isMobile, open, onClose, searchQuery, onSearchChange, activeFolder, onSelectFolder, notebooks, activeNotes, trashedCount, onNewNotebook, onOpenAccount, onNotebookContextMenu, dnd, canInstall, onInstall, syncStatus, online, }) { const notesIn = (nbId) => activeNotes.filter((n) => n.folderId === nbId).length; return (