{#if mealId}

Edit meal components{meal ? `: ${meal.name}` : ''}

{#if mealLoading}

Loading meal…

{:else if mealLoadError} {:else if meal} {#if meal.computed_nutrition_per_meal}

Per meal: {formatKcal(Math.round(meal.computed_nutrition_per_meal.calories ?? 0))} · P {formatGrams(meal.computed_nutrition_per_meal.protein_g ?? 0)} · C {formatGrams(meal.computed_nutrition_per_meal.carbs_g ?? 0)} · F {formatGrams(meal.computed_nutrition_per_meal.fat_g ?? 0)}

{/if} {#if compSearchError}{/if} {#if compResults.length > 0} {/if} {#if compSaveError}{/if}
{/if} {:else if justSaved}

"{justSaved.food.name}" saved

{justSaved.food.brand}

= {formatKcal(liveKcal)}

{#if logError}{/if}
{:else}

{isEdit ? 'Edit food' : isPrefilled ? 'Confirm & edit food' : 'Create food'}

{#if isPrefilled}

Source: {source}

{/if}
Unit type
Macros (optional, per {unitType === 'weight' ? '100g' : 'item'})
{#if unitType === 'weight'}
Serving info (optional)
{/if} {#if error}{/if}
{/if}