mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-04 03:31:00 +02:00
13 lines
368 B
TypeScript
13 lines
368 B
TypeScript
import AiProviderContext from "@app/contexts/aiProviderContext";
|
|
import { useContext } from "react";
|
|
|
|
export function useAiProviderContext() {
|
|
const context = useContext(AiProviderContext);
|
|
if (context === undefined) {
|
|
throw new Error(
|
|
"useAiProviderContext must be used within an AiProviderProvider"
|
|
);
|
|
}
|
|
return context;
|
|
}
|