Files
sofa/lib/atoms/command-palette.ts
T
jake dfc0f67527 Migrate component state to Jotai atoms across settings, explore, and dashboard
Replace ad-hoc useState/useEffect fetch patterns with Jotai atoms and
loadables in StatsDisplay, FilterableTitleRow, BackupScheduleSection,
IntegrationsSection, and CommandPalette. Each component now gets a
scoped Jotai Provider with a pre-initialized store so server-rendered
initial values hydrate correctly. Async data fetching moves into
atom-level loadables, eliminating manual loading flags and cancellation
logic throughout.
2026-03-05 10:09:47 -05:00

10 lines
318 B
TypeScript

import { atom } from "jotai";
import { atomWithStorage } from "jotai/utils";
export const commandPaletteOpenAtom = atom(false);
export const helpOpenAtom = atom(false);
const RECENT_KEY = "cp:recent-searches";
export const MAX_RECENT = 5;
export const recentSearchesAtom = atomWithStorage<string[]>(RECENT_KEY, []);