import React, { useState } from 'react' const DIFFICULTY = { easy: { label: 'Easy', bg: '#F0FDF4', color: '#166534' }, medium: { label: 'Medium', bg: '#FFFBEB', color: '#92400E' }, hard: { label: 'Hard', bg: '#FFF5F5', color: '#991B1B' }, } function pill(ing) { return (typeof ing === 'string' ? ing : ing?.name || '').replace(/_/g, ' ') } export default function RecipeCard({ recipe, rank }) { const [open, setOpen] = useState(false) const pct = Math.round(recipe.match_percentage || 0) const diff = DIFFICULTY[(recipe.difficulty || 'medium').toLowerCase()] || DIFFICULTY.medium const barColor = pct >= 75 ? '#4ADE80' : pct >= 50 ? '#FCD34D' : '#D1D5DB' return (
{recipe.description}
)} {/* External links */}