{#if !loading && visits.length === 0}

No visits found

Use search criteria to find visits

{:else} {#if viewMode === 'table'}
{#snippet cell({ column, row })} {#if column.key === 'Status'} {@html getStatusBadge(row)} {:else if column.key === 'actions'}
{:else} {row[column.key] || '-'} {/if} {/snippet}
{:else}
{#if loading}
{:else}
{#each visits as visit (visit.InternalPVID)} onEditVisit(visit)} onDelete={() => onDeleteVisit(visit)} onViewHistory={() => onViewHistory(visit)} onDischarge={() => onDischarge(visit)} /> {/each}
{/if}
{/if} {#if totalPages > 1}
{(currentPage - 1) * perPage + 1} - {Math.min(currentPage * perPage, totalItems)} of {totalItems}
{currentPage} / {totalPages}
{/if} {/if}