import React from 'react'; interface Field { key: string; label: string; } interface Props { items?: any[]; fields: Field[]; handleRowClick?: (index: number) => void; } const ListTable: React.FC = ({ items = [], fields, handleRowClick = () => {} }) => { if (!items.length) return
No data
; return ( {fields.map(field => )} {items.map((item, index) => ( handleRowClick(index)} > {fields.map(field => )} ))}
{field.label}
{item[field.key]}
); }; export default ListTable;