You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/components/datatables/TableRow.tsx

26 lines
657 B

import { Cell, flexRender } from '@tanstack/react-table';
import clsx from 'clsx';
interface Props<D extends Record<string, unknown> = Record<string, unknown>> {
cells: Cell<D, unknown>[];
className?: string;
onClick?: () => void;
}
export function TableRow<
D extends Record<string, unknown> = Record<string, unknown>
>({ cells, className, onClick }: Props<D>) {
return (
<tr
className={clsx(className, { 'cursor-pointer': !!onClick })}
onClick={onClick}
>
{cells.map((cell) => (
<td key={cell.id}>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</td>
))}
</tr>
);
}