Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'%{nbReimbursements}',
vendors.length
)
: t('Transactions.actions.healthExpenseProcessed.single')
// Normally, pending color is not error/red, but for now we handle this state like this
const type = pending ? 'error' : 'normal'
const icon = pending ? 'hourglass' : 'file'
const reimbursements =
transaction.reimbursements && transaction.reimbursements.data
if (pending) {
if (isModalItem) {
return (
}
style={transactionModalRowStyle}
>
{text}
)
}
return (
}
compact={compact}
/>
)
}
export const HealthExpenseStatusIcon = ({ className = '', pending }) => {
const color = pending ? palette.pomegranate : palette.dodgerBlue
return (
<span style="{healthExpenseStatusIconStyle}">
</span>
)
}
return reimbursements
? reimbursements
.map(
reimbursement =>
reimbursement && reimbursement.bill && reimbursement.bill.vendor
)
.filter(Boolean)
: []
}
const isPending = transaction => {
const vendors = getVendors(transaction)
return vendors.length === 0
}
const transactionModalRowStyle = { color: palette.pomegranate }
const Component = ({
transaction,
compact,
menuPosition,
isModalItem,
breakpoints: { isDesktop }
}) => {
const { t } = useI18n()
const pending = isPending(transaction)
const vendors = getVendors(transaction)
const text = pending
? t('Transactions.actions.healthExpensePending')
: vendors.length > 1
? t('Transactions.actions.healthExpenseProcessed.plural').replace(
'%{nbReimbursements}',
getIcon: ({ transaction }) => {
const color = isPending(transaction)
? palette.pomegranate
: palette.dodgerBlue
return
},
match: transaction => {