import placeholderImage from "../assets/placeholder.svg"; function RecipeDetails({ recipe, onEditClick, onDeleteClick, onShowDeleteModal, isAuthenticated, currentUser }) { if (!recipe) { return (

עדיין לא נבחר מתכון. בחר מתכון מהרשימה או צור מתכון חדש.

); } const handleDelete = () => { onShowDeleteModal(recipe.id, recipe.name); }; // Debug ownership check console.log('Recipe ownership check:', { recipeUserId: recipe.user_id, recipeUserIdType: typeof recipe.user_id, currentUserId: currentUser?.id, currentUserIdType: typeof currentUser?.id, isEqual: recipe.user_id === currentUser?.id }); return (
{/* Recipe Image */}
{recipe.name}

{recipe.name}

{translateMealType(recipe.meal_type)} · {recipe.time_minutes} דקות הכנה

{recipe.made_by && (

המתכון של: {recipe.made_by}

)}
⏱ {recipe.time_minutes} דק׳ 🍽 {translateMealType(recipe.meal_type)}

מצרכים

    {recipe.ingredients.map((ing, idx) => (
  • {ing}
  • ))}

שלבים

    {recipe.steps.map((step, idx) => (
  1. {step}
  2. ))}
{recipe.tags && recipe.tags.length > 0 && ( )} {isAuthenticated && currentUser && Number(recipe.user_id) === Number(currentUser.id) && (
)}
); } function translateMealType(type) { switch (type) { case "breakfast": return "בוקר"; case "lunch": return "צהריים"; case "dinner": return "ערב"; case "snack": return "קינוחים"; default: return type; } } export default RecipeDetails;