import React, { Fragment, memo } from 'react' import MaterialTable from 'material-table' import LiquidPledging from 'Embark/contracts/LiquidPledging' import { FundingContext } from '../context' const { cancelProject } = LiquidPledging.methods 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, cancelFundProfile }) => ( {({ account }) => ({ icon: 'cancel', disabled: rowData.addr.toLowerCase() != account.toLowerCase(), tooltip: 'Cancel', onClick: (event, rowData) => { cancelProject(rowData.idProject || rowData.idProfile) .send() .then(res => { console.log({res}) cancelFundProfile(rowData.idProfile) }) } }) ]} /> } ) export default memo(FunderProfilesTable)