22 lines
811 B
React
22 lines
811 B
React
|
|
import { Grid } from 'gridjs-react';
|
||
|
|
import './BudgetPeriodTransTable.scss';
|
||
|
|
import '../../node_modules/gridjs/dist/theme/mermaid.css'
|
||
|
|
|
||
|
|
const BudgetPeriodTransTable = ({title, transList, isBill}) => {
|
||
|
|
const columns = ['Description', 'Amount'],
|
||
|
|
toCurrency = (amount) => { return '$' + (isBill === true ? '-' : '') + amount; },
|
||
|
|
tableData = transList.map(t => { return [t.description, toCurrency(t.amount)]});
|
||
|
|
|
||
|
|
return (
|
||
|
|
<div className='budget-period-trans-table'>
|
||
|
|
<div className="table-header">
|
||
|
|
<span className="table-title">{ title }</span>
|
||
|
|
</div>
|
||
|
|
<div className='table-container'>
|
||
|
|
<Grid data={tableData} columns={columns} />
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
};
|
||
|
|
|
||
|
|
export default BudgetPeriodTransTable;
|