{#if pageState === 'loading'}
{#each range(5) as i (i)} {/each}
{:else if pageState === 'unauthorized'}

Coming Soon

Notifications are available for admin accounts. This feature will be enabled for all users before launch.

{:else if error}

Unable to Load Notifications

Something went wrong. Please try again.

{:else}

Notifications

{#if suppressed > 0}

{suppressed} money-critical alert{suppressed === 1 ? '' : 's'} suppressed

The unacknowledged queue hit the flood cap. Acknowledge outstanding notifications to re-arm money alerts.

{#if suppressedDetails.length > 0}
    {#each suppressedDetails as d (d.reason)}
  • • {reasonLabels[d.reason] || d.reason}: {d.suppressed_count} suppressed
  • {/each}
{/if}
{/if} {#if notifications.length === 0}

{includeAcknowledged ? 'No notifications yet' : 'No unread notifications'}

{:else}
{#each notifications as n (n.id)} {@const actionable = !n.acknowledged_at && (hasAction(n.reason) === 'approve' || hasAction(n.reason) === 'edit_approve')}
{#if !n.acknowledged_at} {/if}

{getNotificationTitle(n)}

{getNotificationSubtitle(n)}

{#if n.amount !== undefined || n.square_id || n.description}
{#if n.amount !== undefined} Amount: £{n.amount.toFixed(2)} {/if} {#if n.square_id} Square: {n.square_id} {/if} {#if n.description}

{n.description}

{/if}
{/if}
{#if hasAction(n.reason)} {/if} {#if !n.acknowledged_at} {/if}
{/each}
{#if totalPages > 1}

{(page - 1) * perPage + 1}–{Math.min(page * perPage, total)} of {total}

{/if} {/if}
{/if} {#if showApprovalModal && selectedBooking} {/if} {#if showEditRequestModal && selectedEditRequest} {/if}