handleSearch(e.currentTarget.value)} class="w-full bg-zinc-900 border border-zinc-700 rounded-xl pl-9 pr-4 py-2.5 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:border-green-500 transition-colors" />
{#if presetsQuery.isPending}
{#each Array(5) as _}
{/each}
{:else if presetsQuery.isError}

Could not load presets

{:else if !filteredPresets.length}

No presets yet

Save a meal as preset from the diary view or

{:else}
    {#each filteredPresets as preset (preset.id)}
  • {#if expandedId === preset.id}
    {#if preset.entries.length === 0}

    No entries yet

    {:else}
      {#each preset.entries as entry (entry.id)}
    • {/each}
    {/if}
    {/if}
  • {/each}
{/if}
{ creating = false; creatingName = ""; }} title="Create new preset" >
(renamePreset_ = null)} title="Rename preset" >
(editingEntry = null)} title="Edit entry" > {#if editingEntry}

{editingEntry.entry.product.name}

e.currentTarget.select()} class="flex-1 bg-zinc-800 border border-zinc-700 rounded-xl px-4 py-2.5 text-center text-xl font-semibold focus:outline-none focus:border-green-500 transition-colors" />
{/if}
{ addEntryPresetId = null; selectedProduct = null; }} title="Add food to preset" > {#if addEntryPresetId !== null} {#if selectedProduct === null}
handleProductSearch(e.currentTarget.value)} autofocus class="w-full bg-zinc-800 border border-zinc-700 rounded-xl px-4 py-2.5 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:border-green-500 transition-colors" /> {#if productsQuery.isPending && productDebouncedQ}

Searching…

{:else} {/if}
{:else}

{selectedProduct.name}

{kcal(selectedProduct.calories)} kcal / 100g

e.currentTarget.select()} class="flex-1 bg-zinc-800 border border-zinc-700 rounded-xl px-4 py-2.5 text-center text-xl font-semibold focus:outline-none focus:border-green-500 transition-colors" />
{/if} {/if}