import { atom } from 'jotai'; export type ExpandCellAtom = { expand: boolean; data?: any; titles?: Array; viewData?: boolean; }; export type DragBoxAtom = { dragging: boolean; }; export type SearchTableColumnAtom = { searching: boolean; column?: any; }; export const dragBoxAtom = atom({ dragging: false }); export const setDragBoxAtom = atom(null, (_get, set, value: DragBoxAtom) => { set(dragBoxAtom, value); }); export const expandCellAtom = atom({ expand: false }); export const setExpandedCellAtom = atom( null, (_get, set, value: ExpandCellAtom) => { set(expandCellAtom, value); } ); export const searchTableColumnAtom = atom({ searching: false, }); export const setSearchingTableColumnAtom = atom( null, (_get, set, value: SearchTableColumnAtom) => { set(searchTableColumnAtom, value); } );