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 | 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() {
const [scenario] = useSearchParam("scenario");
const [page, setPage] = useState(1);
const { data: fullTableData } = useCoreDataRowFullTableListQuery(
{ scenario: Number(scenario), page: page },
{ skip: !scenario },
);
const fullInputTable = fullTableData?.results;
const tableColumns = createColumns(fullInputTable);
return (
<div className="w-full h-full flex flex-col gap-4 relative">
<DataTable
columns={tableColumns}
data={fullInputTable || []}
rowSelection={{}}
columnSelection
/>
<Paginator page={page} setPage={setPage} data={fullTableData} />
</div>
);
}
|