update: init

This commit is contained in:
hamster1963
2024-11-22 22:20:38 +08:00
commit e5682aacbd
45 changed files with 1834 additions and 0 deletions

12
src/hooks/use-theme.ts Normal file
View File

@@ -0,0 +1,12 @@
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;
};