{m["grooming_backToRoutines"]()}
{m["nav_appSubtitle"]()}
{m.grooming_title()}
(showAddForm = !showAddForm)}> {showAddForm ? m.common_cancel() : m["grooming_addEntry"]()}
{#if form?.error}
{form.error}
{/if} {#if form?.created}
{m["grooming_entryAdded"]()}
{/if} {#if form?.updated}
{m["grooming_entryUpdated"]()}
{/if} {#if form?.deleted}
{m["grooming_entryDeleted"]()}
{/if} {#if showAddForm}
{ return async ({ update }) => { await update(); showAddForm = false; }; }} class="grid grid-cols-2 gap-4" >
{m["grooming_dayOfWeek"]()}
{#each DAY_NAMES as name, idx (idx)}
{name}
{/each}
{m.grooming_action()}
{#each ALL_ACTIONS as action (action)}
{ACTION_LABELS[action]}
{/each}
{m["grooming_notesOptional"]()}
{m.common_add()}
(showAddForm = false)}> {m.common_cancel()}
{/if} {#if schedule.length === 0}
{m["grooming_noEntries"]()}
{:else}
{#each byDay as { name, entries, day } (day)}
{name}
{#each entries as entry (entry.id)}
{ACTION_LABELS[entry.action]}
{#if entry.notes}
{entry.notes}
{/if}
(editingId = editingId === entry.id ? null : entry.id)} > {editingId === entry.id ? m.common_cancel() : m.common_edit()}
{ if (!confirm(m["grooming_confirmDelete"]())) e.preventDefault(); }} >
{m.common_delete()}
{#if editingId === entry.id}
{ return async ({ update }) => { await update(); editingId = null; }; }} class="grid grid-cols-2 gap-3" >
{m["grooming_dayOfWeek"]()}
{#each DAY_NAMES as dayName, idx (idx)}
{dayName}
{/each}
{m.grooming_action()}
{#each ALL_ACTIONS as a (a)}
{ACTION_LABELS[a]}
{/each}
{m.inventory_notes()}
{m.common_save()}
(editingId = null)}> {m.common_cancel()}
{/if}
{/each}
{/each}
{/if}