add files

This commit is contained in:
Ermin Zoronjic 2026-04-28 22:03:15 +02:00
parent 2cb39f0c55
commit ab9dfff33f

View File

@ -0,0 +1,17 @@
import { createContext, useContext } from "react";
const ThemeContext = createContext(null);
function ThemeProvider({ value, children }) {
return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;
}
function useTheme() {
const context = useContext(ThemeContext);
if (!context) {
throw new Error("useTheme must be used within ThemeProvider.");
}
return context;
}
export { ThemeProvider, useTheme };