Routine {routine.routine_date} {routine.part_of_day.toUpperCase()} — innercontext
{m["routines_backToList"]()}

{routine.routine_date}

{routine.part_of_day.toUpperCase()}
{#if form?.error}
{form.error}
{/if} {#if routine.notes}

{routine.notes}

{/if}

{m.routines_steps({ count: steps.length })}

{#if showStepForm} {m["routines_addStepTitle"]()}
{/if} {#if steps.length}
{#each steps as step, i (step.id)}
{#if editingStepId === step.id}
{#if step.product_id !== undefined}
(editDraft.dose = e.currentTarget.value)} placeholder={m["routines_dosePlaceholder"]()} />
(editDraft.region = e.currentTarget.value)} placeholder={m["routines_regionPlaceholder"]()} />
{:else}
(editDraft.action_notes = e.currentTarget.value)} placeholder="optional notes" />
{/if} {#if editError}

{editError}

{/if}
{:else}
⋮⋮ {i + 1}.
{#if step.product_id} {@const product = products.find((p) => p.id === step.product_id)}

{product?.name ?? step.product_id}

{#if product?.brand}

{product.brand}

{/if} {:else if step.action_type}

{step.action_type.replace(/_/g, ' ')}

{:else}

{m["routines_unknownStep"]()}

{/if}
{#if step.dose} {step.dose} {/if}
{/if}
{/each}
{:else}

{m["routines_noSteps"]()}

{/if}
{ if (!confirm(m["routines_confirmDelete"]())) e.preventDefault(); }} >