Meal Templates
Save and reuse your favorite meals
Log to:
{#each MEAL_TYPES as mt}
{mt}
{/each}
{#if loading}
{:else if templates.length === 0}
No templates yet
Templates can be created from the daily log or via API
{:else}
{#each templates as t}
{t.name}
{#if t.meal_type}
{t.meal_type}
{/if} {#if t.is_favorite}
★
{/if}
logTemplate(t.id)} disabled={loggingId === t.id}> {#if loggingId === t.id}
{:else}
{/if} Log
deleteTemplate(t.id)}>Archive
{#if t.items?.length > 0}
{#each t.items as item}
{item.snapshot_food_name}
x{item.quantity}
{Math.round(item.snapshot_calories * item.quantity)} cal
{/each}
Total
{Math.round(t.items.reduce((s, i) => s + i.snapshot_calories * i.quantity, 0))} cal
{/if}
{/each}
{/if}