feat: refactor overview button

This commit is contained in:
hamster1963
2024-12-06 22:55:13 +08:00
parent 1d9e59a9df
commit a3bbd7b2eb
10 changed files with 170 additions and 21 deletions

12
src/hooks/use-filter.tsx Normal file
View File

@@ -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;

10
src/hooks/use-status.tsx Normal file
View File

@@ -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;
}