Hook to access the theme context. Must be used within a ThemeProvider.

If used outside a ThemeProvider.

export const useTheme = (): ThemeContextType => {
const context = useContext(ThemeContext);
if (context === undefined) {
throw new Error("useTheme must be used within a ThemeProvider");
}
return context;
};