mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-02-05 05:00:07 +00:00
13 lines
316 B
TypeScript
13 lines
316 B
TypeScript
import { useContext } from "react";
|
|
import { ThemeProviderContext } from "../components/ThemeProvider";
|
|
|
|
export const useTheme = () => {
|
|
const context = useContext(ThemeProviderContext);
|
|
|
|
if (context === undefined) {
|
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
}
|
|
|
|
return context;
|
|
};
|