setCreateOpen(true)}
@@ -435,23 +444,22 @@ function CardRow({ label, children }: { label: string; children: React.ReactNode
}
function PageHead({
- count,
+ total,
loaded,
- hasMore,
onRefresh,
refreshing,
onAdd,
}: {
- count: number;
+ total: number;
loaded: number;
- hasMore: boolean;
onRefresh: () => void;
refreshing: boolean;
onAdd: () => void;
}) {
- // count == loaded for now; kept separate so a future "showing X of Y"
- // header (when we surface a server-side total) drops in cleanly.
- const showHasMore = hasMore && loaded > 0;
+ // total = COUNT(*) from the API; loaded = how many rows the user has
+ // scrolled in so far. Show the partial count only while it differs
+ // from the total, so a fully-scrolled list reads cleanly.
+ const showLoaded = loaded > 0 && loaded < total;
return (
@@ -461,10 +469,14 @@ function PageHead({
Accounts
- {count}
- {showHasMore && +}
+ {total}
+ {showLoaded && (
+
+ Showing {loaded} of {total} — keep scrolling to load more
+