MCPcopy
hub / github.com/callstack/agent-device / LabStateContextValue

Interface LabStateContextValue

examples/test-app/src/lab-state.tsx:23–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23interface LabStateContextValue {
24 activeCategory: ProductCategory;
25 cartCount: number;
26 cartCounts: Record<string, number>;
27 catalogProducts: typeof LAB_PRODUCTS;
28 detailDrafts: Record<string, ProductDraft>;
29 diagnosticsExpanded: boolean;
30 diagnosticsLoading: boolean;
31 diagnosticsState: 'idle' | 'ready' | 'error';
32 favoriteIds: string[];
33 form: CheckoutFormState;
34 formErrors: string[];
35 isOnline: boolean;
36 isRefreshing: boolean;
37 lastSyncLabel: string;
38 noticeVisible: boolean;
39 notificationsEnabled: boolean;
40 reducedMotionEnabled: boolean;
41 searchDraft: string;
42 submittedSummary: string | null;
43 toastMessage: string | null;
44 addToCart: (productId: string, quantity?: number) => void;
45 decreaseProductQuantity: (productId: string) => void;
46 dismissNotice: () => void;
47 increaseProductQuantity: (productId: string) => void;
48 loadDiagnostics: () => void;
49 resetForm: () => void;
50 resetLabState: () => void;
51 refreshMetrics: () => void;
52 retryDiagnostics: () => void;
53 saveProductToCart: (productId: string) => void;
54 setActiveCategory: (value: ProductCategory) => void;
55 setDiagnosticsExpanded: (value: boolean) => void;
56 setIsOnline: (value: boolean) => void;
57 setNotificationsEnabled: (value: boolean) => void;
58 setProductNote: (productId: string, value: string) => void;
59 setReducedMotionEnabled: (value: boolean) => void;
60 setSearchDraft: (value: string) => void;
61 submitOrder: () => void;
62 toggleFavorite: (productId: string) => void;
63 updateForm: <K extends keyof CheckoutFormState>(field: K, value: CheckoutFormState[K]) => void;
64}
65
66const LabStateContext = createContext<LabStateContextValue | null>(null);
67

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected