38
loading...
This website collects cookies to deliver better user experience
<table className="table">
<thead className="headBg">
<tr>
{headers.map(header => {
return (
<th scope="col" key={header}>
{header}
</th>
);
})}
</tr>
</thead>
<tbody>
{data.map(datum => {
return (
<tr key={datum.id} onClick={() => console.log(datum.id)}>
<td>#{datum.id}</td>
<td className="d-flex justify-content-center align-items-center customer--details">
<img src={datum.image} alt="" />
<span>
{datum.firstname} {datum.lastname}
</span>
</td>
<td>#{datum.transactionId}</td>
<td>{datum.name}</td>
<td>N{datum.amount}</td>
<td className="d-flex justify-content-center align-items-center">{this.renderStatusTag(datum.status)}</td>
<td>{moment(datum.createdAt).format("DD-MM-YYYY")}</td>
<td>{moment(datum.createdAt).format("h:mm a")}</td>
</tr>
);
})}
</tbody>
</table>
<AppTable
headers={['header title 1', 'header title 2']}
data={data}
/>
const earningsData = [
{
id: 23123,
name: 'Jude abaga',
date: 1237682923189813,
amount_paid: '4560000'
},
{
id: 23123,
name: 'Jude Gideon',
date: 12376829231189813,
amount_paid: '560000'
},
]
const userData = [
{
id: 23123,
name: 'Jude abaga',
email: '[email protected]'
date: 1237682923189813,
status: 'pending'
},
{
id: 23128,
name: 'Dev abaga',
email: '[email protected]'
date: 111237682923189813,
status: 'verified'
},
]
<tbody>
{data.map((datum, index) => {
return (
<tr key={datum.id}>
{Object.keys(headers).map((header, index) => {
<td key={index}>
<span>{datum[header]}</span>
</td>
})}
</tr>
);
})}
</tbody>
Object.keys(headers).map((header, index))
<AppTable headers={[]} data={data} />