import { getAllUsers } from "@/lib/api"; import { UserListCard } from "@/components/user-list-card"; import { PaginationNav } from "@/components/pagination-nav"; export default async function AllUsersPage({ searchParams, }: { searchParams: Promise<{ page?: string }>; }) { const { page: pageStr } = await searchParams; const page = parseInt(pageStr ?? "1", 10); const usersData = await getAllUsers(page).catch(() => null); if (!usersData) { return (

All Users

Could not load users. Please try again later.

); } const { items, total, per_page } = usersData; const totalPages = Math.ceil(total / per_page); return (

All Users

Discover other users on Thoughts.

`/users/all?page=${p}`} />
); }