import { getUsersPage } from "@/lib/api";
import UsersTable from "@/components/users-table";

const PREFIX_PATTERN = process.env.NEXT_PUBLIC_CM_PREFIX_PATTERN ?? "13c";

export default async function UsersPage() {
  const page = await getUsersPage({
    prefix: PREFIX_PATTERN,
    sort: "last_update_time",
    dir: "desc",
  });
  return (
    <UsersTable
      initial={page.rows}
      initialHasMore={page.hasMore}
      initialTotal={page.total}
      prefixPattern={PREFIX_PATTERN}
    />
  );
}
