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) { // Convert relative path to public URL const imageSrc = recipe.displayPhoto && recipe.displayPhoto.startsWith('./') ? `/recipes/${recipe.folderPath}/${recipe.displayPhoto.replace('./', '')}`.replace(/\\/g, '/') : recipe.displayPhoto || null; return (
{imageSrc ? ( {`${recipe.title} ) : (
🍽️
)}

{recipe.title}

{recipe.description}

Total time: {recipe.totalTime} min Servings: {recipe.servings} servings
{recipe.tags.slice(0, 3).map((tag) => ( {tag} ))} {recipe.tags.length > 3 && ( +{recipe.tags.length - 3} more )}
); }