fix crash when no quantity is given
This commit is contained in:
@@ -32,7 +32,7 @@ const tableView = true
|
|||||||
ingredients.map((ing, index) => (
|
ingredients.map((ing, index) => (
|
||||||
<>
|
<>
|
||||||
<tr class="border-t border-white/10 cursor-pointer hover:bg-white/10 transition-opacity ingredient-row" data-index={index}>
|
<tr class="border-t border-white/10 cursor-pointer hover:bg-white/10 transition-opacity ingredient-row" data-index={index}>
|
||||||
<td class="px-4 py-2">{ing.quantity.value.value}</td>
|
<td class="px-4 py-2">{ing.quantity ? ing.quantity.value.value : ''}</td>
|
||||||
<td class="px-4 py-2">{ing.unit || ''}</td>
|
<td class="px-4 py-2">{ing.unit || ''}</td>
|
||||||
<td class="px-4 py-2">{ing.name}{ing.preparation ? ` (${ing.preparation})` : ''}</td>
|
<td class="px-4 py-2">{ing.name}{ing.preparation ? ` (${ing.preparation})` : ''}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ const { ingredients, class: className } = Astro.props;
|
|||||||
<div class={className}>
|
<div class={className}>
|
||||||
{ingredients.map(i => (
|
{ingredients.map(i => (
|
||||||
<ul class="text-sm">
|
<ul class="text-sm">
|
||||||
<li class="">{i.quantity.value.value} {i.unit || ""} {i.name} {i.preparation ? `(${i.preparation})` : ''}</li class=""> </ul>
|
<li class="">{i.quantity ? i.quantity.value.value : ''} {i.unit || ""} {i.name} {i.preparation ? `(${i.preparation})` : ''}</li class=""> </ul>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user