12 lines
278 B
TypeScript
12 lines
278 B
TypeScript
import { ThemeContext } from "@/contexts/ThemeContext";
|
|
import { useContext } from "react";
|
|
|
|
export function useTheme() {
|
|
const context = useContext(ThemeContext);
|
|
if (!context) {
|
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
}
|
|
|
|
return context;
|
|
}
|