"use client";
import { defineRegistry, DataProvider, VisibilityProvider, ActionProvider } from "@json-render/react";
import { catalog } from "./catalog";
import { ReactNode } from "react";
export const { registry } = defineRegistry(catalog, {
components: {
RecipeHeader: ({ props }) => (
{props.title}
👨🍳 Chef: {props.chef}
🇫🇷 Origin: {props.origin}
⏱️ Prep: {props.prepTime}
🍽️ Serves: {props.servings}
),
ChefInfo: ({ props }) => (
{props.imageUrl && (

)}
),
IngredientList: ({ props }) => (
🥚 {props.title}
{props.ingredients.map((ingredient: any, index: number) => (
-
•
{ingredient.quantity}
{ingredient.name}
))}
),
InstructionSteps: ({ props }) => (
📝 Instructions
{props.steps.map((step: any) => (
-
{step.number}
{step.instruction}
))}
),
TipCard: ({ props }) => (
💡
“{props.tip}”
— {props.author}
),
RecipeCard: ({ props, children }) => (
{props.imageUrl && (

)}
{props.title}
{props.description}
{children}
),
},
});
// Provider wrapper for all required contexts
export function Provider({ children }: { children: ReactNode }) {
return (
{children}
);
}