2025-05-30 22:38:23 +02:00

11 lines
295 B
TypeScript

import { useContext } from "react"
import { ThemeProviderContext } from "@/lib/theme-context"
export const useTheme = () => {
const context = useContext(ThemeProviderContext)
if (context === undefined)
throw new Error("useTheme must be used within a ThemeProvider")
return context
}