{#if doneForDay}
{summary?.summary_scope === 'week' ? 'Closed today' : 'All done for today!'} {summary?.summary_scope === 'week' ? 'Showing summary from the last working period' : 'No more customers booked for today'}
{:else}
{isInProgress ? 'Current Appointment' : 'Next Appointment'} {#if activeAppointment} {new SvelteDate(activeAppointment.start_time).toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true })} - {new SvelteDate( new SvelteDate(activeAppointment.start_time).getTime() + activeAppointment.duration_minutes * 60 * 1000 ).toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true })} {/if}
{#if activeAppointment} {#if isInProgress}
In Progress • {timeRemaining} min remaining {#if timeRemaining > 29} {#if freeTimeCapped && freeTimeAfter === 0} closing after {:else if freeTimeAfter > 0} {freeTimeAfter} min free afterwards{#if freeTimeCapped} (closing after){/if} {/if} {/if}
{:else} Starts in {timeRemaining} min {/if} {/if}
{/if}
{#if loading}
{:else if doneForDay && summary}
{#if minutesUntilClosing >= 75}

Online booking still open

Users booking online still have time to book in

{/if} {#if minutesUntilClosing >= 30}

Walk-ins closing soon

There is {formatRemainingTime(minutesUntilClosing)} left to accept walk-in bookings

{/if} {#if summary.summary_scope === 'week'}
Summary: {new SvelteDate(summary.summary_start_date).toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' })} – {new SvelteDate(summary.summary_end_date).toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' })}
{/if}
Payments Taken
£{summary.total_payments_today.toFixed(2)}
Tips
£{summary.total_tips_today.toFixed(2)}
Time in Appointments
{formatDuration(summary.total_duration_spent)}
{#if summary.amount_due_today > 0}
Still Due
£{summary.amount_due_today.toFixed(2)}
{#if summary.last_customer_name}
— {summary.last_customer_name}
{/if}
{/if}
Customers Served
{summary.customers_served} {#if summary.total_bookings !== summary.customers_served} across {summary.total_bookings} booking{summary.total_bookings !== 1 ? 's' : ''} {/if}
Customers
{#if summary.new_customers > 0}
{summary.new_customers} new
{/if} {#if summary.returning_customers > 0}
{summary.returning_customers} returning
{/if} {#if summary.guest_customers > 0}
{summary.guest_customers} guest
{/if}
{#if summary.gift_cards_sold > 0}
Gift Cards Sold
{summary.gift_cards_sold}
{/if}
{#if summary.last_customer_name && isMilestone(summary.last_customer_visits ?? 0)}
{summary.last_customer_name} has visited {summary.last_customer_visits} times now!
{/if} {#if summary.new_booking_services && summary.new_booking_services.length > 0}

New bookings made since{summary.summary_scope === 'week' ? ` opening ${new SvelteDate(summary.summary_start_date).toLocaleDateString('en-US', { weekday: 'long' })}` : ' closing yesterday'}

{#each summary.new_booking_services as svc (svc.service_name)}
{svc.count} {svc.service_name}
{/each}
{/if} {#if weekSummary}

This week so far

{new SvelteDate(weekSummary.summary_start_date).toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' })} – {new SvelteDate(weekSummary.summary_end_date).toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' })}
Payments Taken
£{weekSummary.total_payments_today.toFixed(2)}
Tips
£{weekSummary.total_tips_today.toFixed(2)}
{#if weekSummary.amount_due_today > 0}
Still Due
£{weekSummary.amount_due_today.toFixed(2)}
{/if}
Time in Appointments
{formatDuration(weekSummary.total_duration_spent)}
Customers Served
{weekSummary.customers_served}
{#if weekSummary.gift_cards_sold > 0}
Gift Cards Sold
{weekSummary.gift_cards_sold}
{/if}
{/if}
{:else if !activeAppointment}

No appointments right now

Enjoy the break or check tomorrow's schedule

{:else}
{#if activeAppointment.user?.profile_pic_url} {formatUserName(activeAppointment.user.full_name, {:else} {@const initials = activeAppointment.user?.full_name ?.split(' ') .map((n) => n[0]) .join('') || '?'}
{initials}
{/if}
{formatUserName(activeAppointment.user?.full_name || 'Guest', activeAppointment.user?.previous_first_name, activeAppointment.user?.previous_last_name)}
{activeAppointment.user?.phone || '—'}
{#if activeAppointment.user} {/if}
Services
{#each activeAppointment.services as service, index (index)}
{service.service_name || 'Unknown Service'}
{#if service.service_description}
{service.service_description}
{/if}
{formatDuration( service.override_duration_minutes ?? service.duration_minutes ?? 0 )}
{/each}
{#if activeAppointment.notes}
Notes
{activeAppointment.notes}
{/if}
{#if !isInProgress} {/if} {#if isInProgress} {/if}
{/if}
{#if showPaymentModal && activeAppointment} (showPaymentModal = false)} onComplete={handlePaymentComplete} /> {/if}