import { flexRender, getCoreRowModel, getSortedRowModel, useReactTable, } from "@tanstack/react-table"; import { BenchmarkResult } from "../../../types"; import { exportToCsv } from "../export/csvExport"; import { columns } from "./columns"; interface BenchmarkTableProps { results: BenchmarkResult[]; } export function BenchmarkTable({ results }: BenchmarkTableProps) { const table = useReactTable({ data: results, columns, getCoreRowModel: getCoreRowModel(), getSortedRowModel: getSortedRowModel(), }); return (
| {flexRender( header.column.columnDef.header, header.getContext(), )} {header.column.getIsSorted() && ( {header.column.getIsSorted() === "asc" ? "↑" : "↓"} )} | ))}
|---|
| {flexRender(cell.column.columnDef.cell, cell.getContext())} | ))}