organization-settings.ts15 lines · main
| 1 | import { proxy, snapshot, useSnapshot } from 'valtio' |
| 2 | |
| 3 | export type ORG_SETTINGS_PANEL_KEYS = undefined | 'subscriptionPlan' | 'costControl' |
| 4 | |
| 5 | export const orgSettingsPageState = proxy({ |
| 6 | panelKey: undefined as ORG_SETTINGS_PANEL_KEYS, |
| 7 | setPanelKey: (key: ORG_SETTINGS_PANEL_KEYS) => { |
| 8 | orgSettingsPageState.panelKey = key |
| 9 | }, |
| 10 | }) |
| 11 | |
| 12 | export const getOrgSettingsPageStateSnapshot = () => snapshot(orgSettingsPageState) |
| 13 | |
| 14 | export const useOrgSettingsPageStateSnapshot = (options?: Parameters<typeof useSnapshot>[1]) => |
| 15 | useSnapshot(orgSettingsPageState, options) |