Files
nezha-dash-v1/src/hooks/use-tooltip.tsx
2024-12-13 17:26:28 +08:00

13 lines
327 B
TypeScript

import { TooltipContext } from "@/context/tooltip-context"
import { useContext } from "react"
export const useTooltip = () => {
const context = useContext(TooltipContext)
if (context === undefined) {
throw new Error("useTooltip must be used within a TooltipProvider")
}
return context
}
export default useTooltip