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