mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-13 13:25:18 +00:00
fix: extra fields renderin in transactions table
This commit is contained in:
@@ -200,13 +200,13 @@ export function TransactionList({ transactions, fields = [] }: { transactions: T
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderFieldInTable = (transaction: Transaction, field: FieldWithRenderer) => {
|
const renderFieldInTable = (transaction: Transaction, field: FieldWithRenderer): string | React.ReactNode => {
|
||||||
if (field.isExtra) {
|
if (field.isExtra) {
|
||||||
return transaction.extra?.[field.code as keyof typeof transaction.extra]
|
return transaction.extra?.[field.code as keyof typeof transaction.extra] ?? ""
|
||||||
} else if (field.renderer.formatValue) {
|
} else if (field.renderer.formatValue) {
|
||||||
return field.renderer.formatValue(transaction)
|
return field.renderer.formatValue(transaction)
|
||||||
} else {
|
} else {
|
||||||
return transaction[field.code as keyof Transaction]
|
return String(transaction[field.code as keyof Transaction])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user