aboutsummaryrefslogtreecommitdiff
path: root/src/ViewContext.tsx
blob: 794605282be893b9588a16a9abfea095aed94aec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// import { createContext, useContext, useState, ReactNode } from 'react';
// import {ProfilingQuestion} from "@/models/question.ts"
//
// type View = 'offerwall' | 'questions' | 'cashout';
//
// type ViewContextType = {
//     activeView: View;
//     setActiveView: (view: View) => void;
// };
//
// type ProfilingQuestionMap = Map<string, ProfilingQuestion>;
//
// interface ProfilingQuestionsContextType {
//     answers: ProfilingQuestionMap;
//     setAnswer: (questionId: string, values: string[]) => void;
//     clearAnswers: () => void;
// }
//
// interface ProfilingQuestionsContextType {
//     questions: ProfilingQuestion[];
//     setQuestions: (questions: ProfilingQuestion[]) => void;
//     getQuestionById: (id: string) => ProfilingQuestion | undefined;
// }
//
// const ViewContext = createContext<ViewContextType | undefined>(undefined);
//
// export function useViewContext() {
//     const context = useContext(ViewContext);
//     if (!context) {
//         throw new Error('useViewContext must be used within a ViewProvider');
//     }
//     return context;
// }
//
// export function ViewProvider({ children }: { children: ReactNode }) {
//     const [activeView, setActiveView] = useState<View>('offerwall');
//
//     return (
//         <ViewContext.Provider value={{ activeView, setActiveView }}>
//             {children}
//         </ViewContext.Provider>
//     );
// }