// Ledger — bookkeeping prototype // Minimal, photography-of-numbers aesthetic. Single blue accent. const { useState, useEffect, useMemo, useRef, useCallback, useContext, createContext, forwardRef, useImperativeHandle } = React; const F = window.LEDGER_FMT; // LEDGER_DATA is assigned by api.js once the session check + initial fetches // finish; we destructure inside __startApp (bottom of file) so this module can // load even before the network round-trip completes. let CATEGORIES, INITIAL_CATEGORIES, TRANSACTIONS, TODAY, MONTH_BUDGET, SLUG_BY_NAME; const CategoriesContext = createContext({ cats: CATEGORIES, setCats: () => {}, }); const useCats = () => useContext(CategoriesContext); // ────────────────────────────────────────────────────────────────────────────── // Top chrome — global nav + sub nav function GlobalNav({ onAdd, onSearch, search, density, accent, tab, onTab }) { return (
目前範圍:{rangeLabel} {hasRange && <> · 合計 NT$ {Math.round(rangeTotal).toLocaleString('en-US')}>} {!hasRange && <> · 點上方範圍 chip 可篩選日期>}
{body}
}調整外觀、預算與資料管理