19 lines
460 B
TypeScript
19 lines
460 B
TypeScript
import { Card } from "@components/Card.tsx";
|
|
import { Recipe } from "@lib/recipes.ts";
|
|
|
|
export function RecipeCard({ recipe }: { recipe: Recipe }) {
|
|
const { meta: { image = "/placeholder.svg" } = {} } = recipe;
|
|
|
|
const imageUrl = image.startsWith("Recipes/images/")
|
|
? `/api/images?image=${image}&width=200&height=200`
|
|
: image;
|
|
|
|
return (
|
|
<Card
|
|
title={recipe.name}
|
|
image={imageUrl}
|
|
link={`/recipes/${recipe.id}`}
|
|
/>
|
|
);
|
|
}
|