mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 16:56:22 +02:00
19 lines
555 B
TypeScript
19 lines
555 B
TypeScript
"use client";
|
|
|
|
import { atom } from "jotai";
|
|
import { atomWithStorage } from "jotai/utils";
|
|
|
|
/**
|
|
* Set of folder IDs that are currently expanded in the tree, keyed by search space ID.
|
|
* Persisted to localStorage so expand/collapse state survives page refreshes.
|
|
*/
|
|
export const expandedFolderIdsAtom = atomWithStorage<Record<number, number[]>>(
|
|
"surfsense:expandedFolderIds",
|
|
{}
|
|
);
|
|
|
|
/**
|
|
* Folder currently being renamed (inline edit mode).
|
|
* null means no folder is being renamed.
|
|
*/
|
|
export const renamingFolderIdAtom = atom<number | null>(null);
|