Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame contribute delete
723 Bytes
"use client"
import { createContext } from "../create-context"
import type { RecipeProps } from "./generated/recipes.gen"
import type { RecipeKey } from "./use-recipe"
import type { SlotRecipeKey } from "./use-slot-recipe"
const [RecipePropsContextProvider, useParentRecipeProps] = createContext<
RecipeProps<string>
>({
name: "RecipePropsContext",
strict: false,
})
interface Props<T> {
children: React.ReactNode
value: RecipeProps<T>
}
function RecipePropsProvider<T extends RecipeKey | SlotRecipeKey>(
props: Props<T>,
) {
return (
<RecipePropsContextProvider value={props.value}>
{props.children}
</RecipePropsContextProvider>
)
}
export { RecipePropsProvider, useParentRecipeProps }