/** * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ import React, { CSSProperties } from "react"; import { flexRender } from '@tanstack/react-table' import type { Table, Header, Cell } from "@tanstack/react-table"; import { TableHeader } from "./table-header"; interface TableProps { table: Table; className?: string; } export function Table({ className, table }: TableProps) { return (
{table.getRowModel().rows.map(row => ( {row.getVisibleCells().map(cell => ( ))} ))}
{flexRender(cell.column.columnDef.cell, cell.getContext())}
) } function getWidthStyles(table: Table, cell: Cell | Header): CSSProperties { return { width: cell.column.getSize(), } }