liquid-funding/app/components/FunderProfilesTable.jsx

30 lines
929 B
React
Raw Normal View History

2018-12-02 13:24:31 +00:00
import React, { Fragment, memo } from 'react'
import MaterialTable from 'material-table'
const convertToHours = seconds => seconds / 60 / 60
const cancelText = canceled => canceled ? 'Yes' : 'No'
const formatField = field => ({
...field,
commitTime: convertToHours(field.commitTime),
canceled: cancelText(field.canceled)
})
const FunderProfilesTable = ({ data }) => (
<Fragment>
<MaterialTable
columns={[
2018-12-03 13:50:15 +00:00
{ title: 'Profile Id', field: 'idProfile', type: 'numeric' },
2018-12-02 13:24:31 +00:00
{ title: 'Name', field: 'name' },
{ title: 'Url', field: 'url' },
{ title: 'Admin Address', field: 'addr'},
2018-12-02 13:24:31 +00:00
{ title: 'Commit Time', field: 'commitTime', type: 'numeric' },
2018-12-03 13:50:15 +00:00
{ title: 'Type', field: 'type' },
2018-12-02 14:46:20 +00:00
{ title: 'Canceled', field: 'canceled' }
2018-12-02 13:24:31 +00:00
]}
data={data.map(formatField)}
title="Funding Profiles"
/>
</Fragment>
)
export default memo(FunderProfilesTable)