Spaces:
Running
Running
Signs on the film, draw tool, My search off by default, example films and Radiopaedia links (part 2)
2e6a666 verified Download frontend/src/reference/store.ts from yashwrites/blindspot: direct link, hf CLI and curl.
- Browser
- Download file 980 Bytes
-
https://huggingface.co/spaces/yashwrites/blindspot/resolve/main/frontend/src/reference/store.ts
- Command line
-
hf download hf://spaces/yashwrites/blindspot/frontend/src/reference/store.ts
-
curl -L -o store.ts https://huggingface.co/spaces/yashwrites/blindspot/resolve/main/frontend/src/reference/store.ts
980 Bytes
| // Which finding type the reference drawer shows (null = closed). A tiny store so any "i" on any page can open it. | |
| // Round 5: a debrief row may pass the schematic ids of the signs drawn on the film, listed first in "Signs to know". | |
| import { create } from 'zustand'; | |
| export type OpenOptions = { signIds?: string[] }; | |
| type Store = { label: string | null; signIds: string[]; open: (label: string, opts?: OpenOptions) => void; close: () => void }; | |
| export const useReference = create<Store>()((set) => ({ | |
| label: null, | |
| signIds: [], | |
| open: (label, opts) => set({ label, signIds: opts?.signIds ?? [] }), | |
| close: () => set({ label: null, signIds: [] }), | |
| })); | |
| /** Open the "What does this look like?" drawer for a finding type (label id, e.g. "nodule"). Mount <ReferenceDrawer/> once on the page. */ | |
| export const openReference = (label: string, opts?: OpenOptions) => useReference.getState().open(label, opts); | |
| export const closeReference = () => useReference.getState().close(); | |