import { createContext, type ReactNode, useContext } from "react"; import { useBestiary } from "../hooks/use-bestiary.js"; export type { SearchResult } from "../hooks/use-bestiary.js"; type BestiaryContextValue = ReturnType; const BestiaryContext = createContext(null); export function BestiaryProvider({ children }: { children: ReactNode }) { const value = useBestiary(); return ( {children} ); } export function useBestiaryContext(): BestiaryContextValue { const ctx = useContext(BestiaryContext); if (!ctx) throw new Error("useBestiaryContext requires BestiaryProvider"); return ctx; }