import { createContext, FC, useContext, useState } from "react"; import { MobileSections } from "../../types"; export interface SheetContextType { mobileActiveSectionId: MobileSections; setMobileActiveSectionId: (sectionId: MobileSections) => void; setSwipedAmount: (amount: number) => void; swipedAmount: number; } export const SheetContext = createContext(null!); export const SheetProvider: FC = ({ children }) => { const [mobileActiveSectionId, setMobileActiveSectionId] = useState("main"); const [swipedAmount, setSwipedAmount] = useState(0); return ( {children} ); }; export const useSheetContext = () => { return useContext(SheetContext); };