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.description}