import React, { type ReactNode } from 'react'; import styles from './TableMini.module.css'; import { classNames } from '../../utils'; export type TableMiniColumn = { id: string; width?: number | string; align?: 'left' | 'right' | 'center'; renderCell(row: T): ReactNode; className?: string; }; export type TableMiniProps = { /** * className for the element. */ className?: string; /** * The columns to display. */ columns: TableMiniColumn[]; /** * The data to display. */ data: T[]; /** * Function to get a row's unique identifier. */ getRowId: (row: T) => string; }; export function TableMini({ data, columns, getRowId, className, ...rest }: TableMiniProps) { return ( {data.map((row) => ( {columns.map((column) => ( ))} ))}
{column.renderCell(row)}
); }