mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-11-04 17:10:20 +00:00
feat: refactor overview button
This commit is contained in:
1 parent
1d9e59a9df
commit
a3bbd7b2eb
10 files changed
+170
-21
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import { useContext } from "react";
|
||||
import { FilterContext, FilterContextType } from "@/context/filter-context";
|
||||
|
||||
const useFilter = (): FilterContextType => {
|
||||
const context = useContext(FilterContext);
|
||||
if (context === undefined) {
|
||||
throw new Error("useFilter must be used within a FilterProvider");
|
||||
}
|
||||
return context;
|
||||
};
|
||||
|
||||
export default useFilter;
|
||||
@@ -0,0 +1,10 @@
|
||||
import { useContext } from "react";
|
||||
import { StatusContext } from "../context/status-context";
|
||||
|
||||
export function useStatus() {
|
||||
const context = useContext(StatusContext);
|
||||
if (context === undefined) {
|
||||
throw new Error("useStatus must be used within a StatusProvider");
|
||||
}
|
||||
return context;
|
||||
}
|
||||
Reference in new issue
Block a user