fosrl.pangolin/src/hooks/useApikeyContext.ts
2025-05-13 11:09:38 -04:00

12 lines
343 B
TypeScript

import ApiKeyContext from "@app/contexts/apiKeyContext";
import { useContext } from "react";
export function useApiKeyContext() {
const context = useContext(ApiKeyContext);
if (context === undefined) {
throw new Error(
"useApiKeyContext must be used within a ApiKeyProvider"
);
}
return context;
}