Files
oranguru/src/Former/FormerLayoutTop.tsx
Hein f737b1d11d feat(globalStateStore): implement global state management with persistence
- refactor state structure to include app, layout, navigation, owner, program, session, and user
- add slices for managing program, session, owner, user, layout, navigation, and app states
- create context provider for global state with automatic fetching and throttling
- implement persistence using IndexedDB with localStorage fallback
- add comprehensive README documentation for usage and API
2026-02-07 20:03:27 +02:00

24 lines
729 B
TypeScript

import { useFormerStore } from './Former.store';
import { FormerButtonArea } from './FormerButtonArea';
export const FormerLayoutTop = () => {
const { buttonArea, getState, opened, renderTop,setState } = useFormerStore((state) => ({
buttonArea: state.layout?.buttonArea,
getState: state.getState,
opened: state.opened,
renderTop: state.layout?.renderTop,
setState: state.setState,
}));
if (renderTop) {
return renderTop(
<FormerButtonArea />,
opened ?? false,
getState('onClose') ?? (() => {setState('opened', false)}),
getState('onOpen') ?? (() => {setState('opened', true)}),
getState
);
}
return buttonArea === "top" ? <FormerButtonArea /> : <></>;
};