Make amount for an ingredient optional.

This commit is contained in:
araemer 2025-10-21 15:32:48 +02:00
parent 3c9c94957f
commit 0dc2eb2e3c
4 changed files with 122 additions and 96 deletions

View file

@ -58,7 +58,7 @@ export default function RecipeDetailPage() {
...ingGrp,
ingredientList: ingGrp.ingredientList.map((ing) => ({
...ing,
amount: ing.amount * factor,
amount: ing.amount !== undefined ? ing.amount * factor : ing.amount,
}))
}))
@ -121,7 +121,7 @@ export default function RecipeDetailPage() {
<ul className="default-list">
{group.ingredientList.map((ing, j) => (
<li key={j}>
{ing.amount} {ing.unit ?? ""} {ing.name}
{ing.amount ?? ""} {ing.unit ?? ""} {ing.name}
</li>
))}
</ul>