import Loading from './Loading'; import classNames from 'classnames'; export interface TableColumn { title: string; key: string; render?: (row: any) => React.ReactNode; className?: string; } interface TableRow { [key: string]: any; } interface TableProps { columns: TableColumn[]; rows: TableRow[]; isLoading: boolean; onRefresh: () => void; } export default function UniversalTable({ columns, rows, isLoading, onRefresh = () => {} }: TableProps) { return (
Empty
{column.title} | ))}
---|
{column.render ? column.render(row) : row[column.key]} | ))}