feat: sort provider

This commit is contained in:
hamster1963
2024-12-15 22:10:34 +08:00
parent 9551d46800
commit 6e9f1f11af
5 changed files with 100 additions and 45 deletions

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

@@ -0,0 +1,10 @@
import { SortContext } from "@/context/sort-context"
import { useContext } from "react"
export function useSort() {
const context = useContext(SortContext)
if (context === undefined) {
throw new Error("useStatus must be used within a SortProvider")
}
return context
}