Enhance TransactionsTable with custom cell renderers for description and recipient fields, and adjust row height for improved layout.

This commit is contained in:
sebseb7
2025-07-20 04:58:29 +02:00
parent 9a0c985bfa
commit 992adc7bcf

View File

@@ -36,7 +36,8 @@ class TransactionsTable extends Component {
width: 350, width: 350,
sortable: true, sortable: true,
headerComponent: TextHeaderWithFilter, headerComponent: TextHeaderWithFilter,
tooltipField: 'description' tooltipField: 'description',
cellRenderer: this.DescriptionRenderer
}, },
{ {
headerName: 'Empfänger/Zahler', headerName: 'Empfänger/Zahler',
@@ -44,7 +45,8 @@ class TransactionsTable extends Component {
width: 200, width: 200,
sortable: true, sortable: true,
headerComponent: TextHeaderWithFilter, headerComponent: TextHeaderWithFilter,
tooltipField: 'Beguenstigter/Zahlungspflichtiger' tooltipField: 'Beguenstigter/Zahlungspflichtiger',
cellRenderer: this.RecipientRenderer
}, },
{ {
headerName: 'Betrag', headerName: 'Betrag',
@@ -156,7 +158,7 @@ class TransactionsTable extends Component {
// Performance optimizations // Performance optimizations
suppressChangeDetection: false, suppressChangeDetection: false,
// Row height // Row height
rowHeight: 35, rowHeight: 26,
headerHeight: 40, headerHeight: 40,
// Pagination (optional - can be removed for infinite scrolling) // Pagination (optional - can be removed for infinite scrolling)
pagination: false, pagination: false,
@@ -189,6 +191,22 @@ class TransactionsTable extends Component {
}; };
// Custom cell renderers as React components // Custom cell renderers as React components
DescriptionRenderer = (params) => {
return (
<span style={{ fontSize: '0.7rem', lineHeight: '1.2' }}>
{params.value}
</span>
);
};
RecipientRenderer = (params) => {
return (
<span style={{ fontSize: '0.7rem', lineHeight: '1.2' }}>
{params.value}
</span>
);
};
AmountRenderer = (params) => { AmountRenderer = (params) => {
const amount = params.value; const amount = params.value;
const color = amount >= 0 ? '#388e3c' : '#d32f2f'; const color = amount >= 0 ? '#388e3c' : '#d32f2f';