{#if scannerOpen} scannerOpen = false} /> {/if}
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 network.online} {/if}
{#if scanError}

{scanError}

{/if}
{#if productsQuery.isPending}
{#each Array(6) as _}
{/each}
{:else if productsQuery.data?.products.length === 0}
{#if !network.online}

No cached products match "{q}"

Connect to internet to search all products

{:else}

No products found

Try a different name or

Create "{q || 'new product'}" {/if}
{:else}
    {#each productsQuery.data?.products ?? [] as product (product.id)}
  • {/each}
{/if}
{ selectedProduct = null; error = ''; }} title={selectedProduct?.name ?? ''} > {#if selectedProduct} {#if preview}
{#each [ { label: 'kcal', value: preview.calories }, { label: 'protein', value: preview.protein + 'g' }, { label: 'carbs', value: preview.carb + 'g' }, { label: 'fat', value: preview.fat + 'g' }, ] as m}

{m.value}

{m.label}

{/each}
{/if}
{#if error}

{error}

{/if} {/if}