fix: edge case with suspensions shorter than 1 day

This commit is contained in:
Sérgio Salgado 2021-07-19 19:25:59 +01:00 committed by Josh Harvey
parent c0218e672f
commit fe665f1e9c
5 changed files with 15 additions and 10 deletions

View file

@ -6,8 +6,10 @@ const CUSTOMER_BLOCKED = 'blocked'
const getAuthorizedStatus = it =>
it.authorizedOverride === CUSTOMER_BLOCKED
? { label: 'Blocked', type: 'error' }
: it.daysSuspended > 0
? { label: `${it.daysSuspended} day suspension`, type: 'warning' }
: it.isSuspended
? it.daysSuspended > 0
? { label: `${it.daysSuspended} day suspension`, type: 'warning' }
: { label: `< 1 day suspension`, type: 'warning' }
: { label: 'Authorized', type: 'success' }
const getFormattedPhone = (phone, country) => {