Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 12x 8x 8x 8x 8x 12x 10x 8x 12x 4x 12x 8x 16x 4x 16x 16x | import { useState } from "react";
import { createColumns, DataTable } from "@/ahuora-design-system/ui/data-table";
import Paginator from "@/ahuora-design-system/ui/paginator";
import { useSearchParam } from "@/hooks/searchParams";
import { useCoreDataRowFullTableListQuery } from "../../../api/apiStore.gen";
export default function DataViewer({ scenario }: { scenario?: number } = {}) {
const [scenarioSearchParam] = useSearchParam("scenario");
const [page, setPage] = useState(1);
const scenarioId = scenario ?? Number(scenarioSearchParam);
const { data: fullTableData } = useCoreDataRowFullTableListQuery(
{ scenario: scenarioId, page: page },
{ skip: !scenarioId },
);
const fullInputTable = fullTableData?.results;
const tableColumns = createColumns(fullInputTable);
return (
<div className="flex h-full min-h-0 w-full flex-col overflow-hidden">
<div className="min-h-0 flex-1">
<DataTable
columns={tableColumns}
data={fullInputTable || []}
rowSelection={{}}
columnSelection
stickyControls
constrainedHeight
/>
</div>
<div className="sticky bottom-0 z-20 shrink-0 border-t bg-background pt-3">
<Paginator page={page} setPage={setPage} data={fullTableData} />
</div>
</div>
);
}
|