import { createContext, ReactNode, useContext, useState } from 'react'; interface ModalLoginContextType { showModalLogin: boolean; setShowModalLogin: (value: boolean) => void; } const ModalLoginContext = createContext( undefined ); export const ModalLoginProvider = ({ children }: { children: ReactNode }) => { const [showModalLogin, setShowModalLogin] = useState(false); return ( {children} ); }; export const useModalLogin = () => { const context = useContext(ModalLoginContext); if (!context) { throw new Error('useModalLogin must be used within an ModalLoginProvider'); } return context; };