hdwposxy/src/utils/order.ts

13 lines
483 B
TypeScript

export const resolveOrderStatus = (status: string) => {
if (status === 'received' || status === 'fulfilled')
return { text: status, color: 'success' }
else if (status === 'polled')
return { text: status, color: 'info' }
else if (status === 'intransit polled')
return { text: status, color: 'warning' }
else if (status === 'canceled' || status === 'unfulfillable')
return { text: status, color: 'error' }
else
return { text: status, color: 'primary' }
}