updated the columns for transactions

This commit is contained in:
csawatzky 2025-04-08 14:39:24 -06:00
parent 97bbd41492
commit d3431f5559
4 changed files with 36 additions and 47 deletions

View file

@ -39,19 +39,23 @@ export default function TransactionViewer(props: Props) {
{
title: "Date",
render: row => {
return <Typography>{moment(row.transaction.timestamp).format("YYYY-MM-DD")}</Typography>;
return (
<Box padding={2}>
<Typography>{moment(row.transaction.timestamp).format("YYYY-MM-DD")}</Typography>
</Box>
);
}
},
{
title: "From",
render: row => {
return (
<React.Fragment>
<Box padding={2}>
<Typography>{ObjectDescriber(row.transaction.fromObject).name}</Typography>
<Typography>
{objectNames ? objectNames.get(row.transaction.fromKey) : row.transaction.fromKey}
</Typography>
</React.Fragment>
</Box>
);
}
},
@ -59,65 +63,45 @@ export default function TransactionViewer(props: Props) {
title: "To",
render: row => {
return (
<React.Fragment>
<Box padding={2}>
<Typography>{ObjectDescriber(row.transaction.toObject).name}</Typography>
<Typography>
{objectNames ? objectNames.get(row.transaction.toKey) : row.transaction.toKey}
</Typography>
</React.Fragment>
</Box>
);
}
},
{
title: "Transaction",
render: row => {
return <TransactionDataDisplay transaction={row} />;
return (
<Box padding={2}>
<TransactionDataDisplay transaction={row} />
</Box>
);
}
}
];
const handleChange = (event: any) => {
setPageSize(event.target.value);
};
const myTable = () => {
return (
<ResponsiveTable<Transaction>
isLoading={loading}
title={"Inventory Transactions"}
page={tablePage}
columns={columns}
pageSize={pageSize}
rows={displayedRows}
total={transactions.length}
setPage={page => setTablePage(page)}
handleRowsPerPageChange={() => {}}
handleRowsPerPageChange={handleChange}
/>
)
// return (
// <MaterialTable
// isLoading={loading}
// key="devicesList"
// icons={getTableIcons()}
// columns={columns}
// data={transactions}
// options={{
// paging: true,
// pageSize: 10,
// pageSizeOptions: [5, 10, 20],
// padding: "dense",
// showTitle: true,
// toolbar: true,
// sorting: true,
// columnsButton: true,
// search: false
// }}
// localization={{
// body: { emptyDataSourceMessage: loading ? "" : "No Transactions found" }
// }}
// components={{
// Toolbar: props => (
// <React.Fragment>
// <MTableToolbar {...props} />
// </React.Fragment>
// )
// }}
// title="Inventory Transactions"
// />
// );
};
return <Box>{myTable()}</Box>;