MCPcopy Create free account
hub / github.com/codeaashu/claude-code / WizardProvider

Function WizardProvider

src/components/wizard/WizardProvider.tsx:9–203  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

7// eslint-disable-next-line @typescript-eslint/no-explicit-any
8export const WizardContext = createContext<WizardContextValue<any> | null>(null);
9export function WizardProvider(t0) {
10 const $ = _c(38);
11 const {
12 steps,
13 initialData: t1,
14 onComplete,
15 onCancel,
16 children,
17 title,
18 showStepCounter: t2
19 } = t0;
20 let t3;
21 if ($[0] !== t1) {
22 t3 = t1 === undefined ? {} as T : t1;
23 $[0] = t1;
24 $[1] = t3;
25 } else {
26 t3 = $[1];
27 }
28 const initialData = t3;
29 const showStepCounter = t2 === undefined ? true : t2;
30 const [currentStepIndex, setCurrentStepIndex] = useState(0);
31 const [wizardData, setWizardData] = useState(initialData);
32 const [isCompleted, setIsCompleted] = useState(false);
33 let t4;
34 if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
35 t4 = [];
36 $[2] = t4;
37 } else {
38 t4 = $[2];
39 }
40 const [navigationHistory, setNavigationHistory] = useState(t4);
41 useExitOnCtrlCDWithKeybindings();
42 let t5;
43 let t6;
44 if ($[3] !== isCompleted || $[4] !== onComplete || $[5] !== wizardData) {
45 t5 = () => {
46 if (isCompleted) {
47 setNavigationHistory([]);
48 onComplete(wizardData);
49 }
50 };
51 t6 = [isCompleted, wizardData, onComplete];
52 $[3] = isCompleted;
53 $[4] = onComplete;
54 $[5] = wizardData;
55 $[6] = t5;
56 $[7] = t6;
57 } else {
58 t5 = $[6];
59 t6 = $[7];
60 }
61 useEffect(t5, t6);
62 let t7;
63 if ($[8] !== currentStepIndex || $[9] !== navigationHistory || $[10] !== steps.length) {
64 t7 = () => {
65 if (currentStepIndex < steps.length - 1) {
66 if (navigationHistory.length > 0) {

Callers

nothing calls this directly

Calls 2

onCancelFunction · 0.50

Tested by

no test coverage detected