import Link from 'next/link'; import Image from 'next/image'; import type { RecipeMetadata } from '@/lib/recipes'; interface RecipeCardProps { recipe: RecipeMetadata & { folderPath: string }; } export default function RecipeCard({ recipe }: RecipeCardProps) { const imageRelativePath = recipe.displayPhoto.startsWith('./') ? `${recipe.folderPath}/${recipe.displayPhoto.replace('./', '')}` : recipe.displayPhoto; const normalizedPath = imageRelativePath.replace(/\\/g, '/'); const imageSrc = `/api/recipe-image?path=${encodeURIComponent(normalizedPath)}`; return (
{recipe.title}

{recipe.title}

{recipe.description}

⏱️ {recipe.totalTime} min 👥 {recipe.servings} servings {recipe.difficulty === 'easy' && '⭐'} {recipe.difficulty === 'medium' && '⭐⭐'} {recipe.difficulty === 'hard' && '⭐⭐⭐'}
{recipe.tags.slice(0, 3).map((tag) => ( {tag} ))} {recipe.tags.length > 3 && ( +{recipe.tags.length - 3} )}
); }