({
position = 'right',
open = false,
hue = 270,
}: InspectorProps)
| 9 | import {Panel} from './Panel.tsx'; |
| 10 | |
| 11 | export const Inspector = ({ |
| 12 | position = 'right', |
| 13 | open = false, |
| 14 | hue = 270, |
| 15 | }: InspectorProps) => { |
| 16 | const s = useCreateStore(createStore); // The inspector's Store throughout. |
| 17 | |
| 18 | useCreatePersister( |
| 19 | s, |
| 20 | (s) => createSessionPersister(s, UNIQUE_ID), |
| 21 | undefined, |
| 22 | async (persister) => { |
| 23 | await persister.load([ |
| 24 | {}, |
| 25 | { |
| 26 | position: getInitialPosition(position), |
| 27 | open: !!open, |
| 28 | }, |
| 29 | ]); |
| 30 | await persister.startAutoSave(); |
| 31 | }, |
| 32 | ); |
| 33 | |
| 34 | return ( |
| 35 | <> |
| 36 | <aside id={UNIQUE_ID} style={{'--hue': hue} as CSSProperties}> |
| 37 | <Nub s={s} /> |
| 38 | <Panel s={s} /> |
| 39 | </aside> |
| 40 | <style>{APP_STYLESHEET}</style> |
| 41 | </> |
| 42 | ); |
| 43 | }; |
nothing calls this directly
no test coverage detected
searching dependent graphs…