{#if error}
{error}
{/if} {#if showAdd && canManage}
{/if} {#if ($allShifts ?? []).length === 0 && !showAdd}
No shifts yet

Add shifts to schedule your volunteers.

{:else} {#each board as { dept, days }} {#if days.length > 0}
{dept.name}
{#each days as [day, rows]}
{formatDay(day)}
{#each rows as { shift, assigned, hasConflict }, i}
{#if editShiftID === shift.id}
{:else}
{shift.name} {fmt(shift.start_time)}–{fmt(shift.end_time)} {#if shift.capacity > 0} {assigned.length}/{shift.capacity} {:else if assigned.length > 0} {assigned.length} {/if} {#if hasConflict} ⚠ conflict {/if}
{#if assigned.length > 0}
{#each assigned as { vs, volunteer }}
{volunteer.name} {#if checkConflict(volunteer.id, shift.id, $allVolunteerShifts ?? [], $allShifts ?? [])} {/if}
{/each}
{/if} {#if assigningShiftID === shift.id}
{:else} {/if} {/if}
{/each} {/each}
{/if} {/each} {/if}