Bin
2025-12-17 21f0498f62ada55651f4d232327e15fc47f498b1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { atom } from "jotai";
import { getQueryParams } from "../utils/query";
 
export const defaultConfig = "<View>\n  <!-- Paste your XML config here -->\n</View>";
 
export const configAtom = atom<string>(defaultConfig);
export const loadingAtom = atom<boolean>(false);
export const errorAtom = atom<string | null>(null);
export const interfacesAtom = atom<string[]>([]);
export const showPreviewAtom = atom<boolean>(true);
export const sampleTaskAtom = atom<any>({});
export const annotationAtom = atom<any>([]);
export const modeAtom = atom<"preview" | "editor" | "">("editor");
export const displayModeAtom = atom<"preview" | "preview-inline" | "all">(() => {
  const params = getQueryParams();
  const mode = params.get("mode");
  if (mode === "preview") return "preview";
  if (mode === "preview-inline") return "preview-inline";
  return "all";
});