import React, { createContext, useContext, useState } from 'react'; interface PromoContextData { showPromo: boolean; setShowPromo: (showPromo: boolean) => void; } const PromoContext = createContext(undefined); interface PromoContextProviderProps { children: React.ReactNode; } const PromoContextProvider: React.FC = ({ children, }) => { const [showPromo, setShowPromo] = useState(false); return ( {children} ); }; export function usePromoContext() { const context = useContext(PromoContext); if (!context) { throw new Error( 'usePromoContext must be used within a PromoContextProvider', ); } return context; } export { PromoContext, PromoContextProvider };