mirror of
https://github.com/woodchen-ink/nezha-dash-v1.git
synced 2025-07-18 01:21:56 +08:00
12 lines
293 B
TypeScript
12 lines
293 B
TypeScript
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
|
|
}
|