import { findAllDeployments, findAllRunsWithCounts, } from "../server/findAllRuns"; import { DeploymentDisplay } from "./DeploymentDisplay"; import { PaginationControl } from "./PaginationControl"; import { RunDisplay } from "./RunDisplay"; import { Table, TableBody, TableCaption, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { parseAsInteger } from "next-usequerystate"; const itemPerPage = 6; const pageParser = parseAsInteger.withDefault(1); export async function RunsTable(props: { workflow_id: string; searchParams: { [key: string]: string | string[] | undefined }; }) { // await new Promise((resolve) => setTimeout(resolve, 5000)); const page = pageParser.parseServerSide( props.searchParams?.page ?? undefined ); const { allRuns, total } = await findAllRunsWithCounts({ workflow_id: props.workflow_id, limit: itemPerPage, offset: (page - 1) * itemPerPage, }); return (