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