fix: recepty přesnuty k jídlům

feat: přidána podpora fotek
This commit is contained in:
Ondřej Anděl committed 2026-10-12 10:20:12 +02:00
1 parent efed5e6e86
commit e13f7ce8e5
39 files changed
+1266 -511

No files matched your search

+3 -10
View File
@@ -1,7 +1,6 @@
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faPenToSquare, faTrash } from "@fortawesome/free-solid-svg-icons";
import { MealTemplate } from "../../../types";
import { MEAL_TYPE_ICONS, MEAL_TYPE_NAMES } from "../enums";
import { deriveRecipe, formatCalories, formatPrice, formatWeight, getIngredientCalories } from "../Utils";
type Props = {
@@ -12,8 +11,8 @@ type Props = {
};
/**
* Karta receptu na stránce Šablony — suroviny, hodnoty celého hrnce i jedné
* porce a postup.
* Karta receptu uvnitř jídla v seznamu jídel — suroviny, hodnoty celého hrnce
* i jedné porce a postup. Název a zdroj neopakuje, nese je jídlo.
*/
const MealTemplateCard = ({ template, busy, onEdit, onDelete }: Readonly<Props>) => {
const recipe = deriveRecipe(template.ingredients, template.servings, template.cookedWeight);
@@ -22,13 +21,7 @@ const MealTemplateCard = ({ template, busy, onEdit, onDelete }: Readonly<Props>)
<div className="card-panel template-card">
<div className="template-head">
<div className="template-title">
{template.name}
{template.mealType && (
<span className="tag">
{MEAL_TYPE_ICONS[template.mealType]} {MEAL_TYPE_NAMES[template.mealType]}
</span>
)}
{template.source && <span className="tag">{template.source}</span>}
Recept
{template.weight != null && <span className="tag">porce {formatWeight(template.weight)}</span>}
{(template.servings ?? 1) > 1 && (
<span className="tag">{template.servings} porcí</span>