{#each ingredients as group, groupIndex}
{#if group.type === 'reference'} 🔗 Base Recipe Reference {#if group.labelOverride !== undefined} updateLabelOverride(groupIndex, e)} placeholder="Label override (optional)" /> {/if} {#if group.itemsBefore && group.itemsBefore.length > 0}
{#each group.itemsBefore as item, itemIndex}
updateItemBefore(groupIndex, itemIndex, 'amount', e)} placeholder="Amt" /> updateItemBefore(groupIndex, itemIndex, 'unit', e)} placeholder="Unit" /> updateItemBefore(groupIndex, itemIndex, 'name', e)} placeholder="Ingredient name" />
{/each}
{/if} {#if group.itemsAfter && group.itemsAfter.length > 0}
{#each group.itemsAfter as item, itemIndex}
updateItemAfter(groupIndex, itemIndex, 'amount', e)} placeholder="Amt" /> updateItemAfter(groupIndex, itemIndex, 'unit', e)} placeholder="Unit" /> updateItemAfter(groupIndex, itemIndex, 'name', e)} placeholder="Ingredient name" />
{/each}
{/if} {:else} updateIngredientGroupName(groupIndex, e)} placeholder="Ingredient group name" /> {#each group.list as item, itemIndex}
updateIngredientItem(groupIndex, itemIndex, 'amount', e)} placeholder="Amt" /> updateIngredientItem(groupIndex, itemIndex, 'unit', e)} placeholder="Unit" /> updateIngredientItem(groupIndex, itemIndex, 'name', e)} placeholder="Ingredient name" />
{/each} {/if}
{/each}