import { Handlers, PageProps } from "$fresh/server.ts"; import { IngredientsList } from "@islands/IngredientsList.tsx"; import { RecipeHero } from "@components/RecipeHero.tsx"; import { MainLayout } from "@components/layouts/main.tsx"; import Counter from "@islands/Counter.tsx"; import { useSignal } from "@preact/signals"; import { getRecipe, Recipe } from "@lib/resource/recipes.ts"; export const handler: Handlers = { async GET(_, ctx) { const recipe = await getRecipe(ctx.params.name); return ctx.render(recipe); }, }; export default function Greet(props: PageProps) { const recipe = props.data; const portion = recipe.meta?.portion; const amount = useSignal(portion || 1); return ( ${recipe.name}`}>

Ingredients

{portion && }

Preparation

          {recipe.preparation}
        
); }