You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
const bookingStatusMap = status => { switch (status) { case -1: return 'Cancelled' case 0: return 'Unpaid' case 1: return 'Awaiting Confirmation' case 2: return 'Confirmed' case 3: return 'Processing' case 4: return 'Completed' default: break } } const supplierStatusMap = status => { switch (status) { case -1: return 'Cancelled' case 0: return 'Considering' case 1: return 'Confirmed' case 2: return 'Processing' case 3: return 'Completed' default: break } } const paymentStatusMap = status => { switch (status) { case -99: return 'Refunded' case -98: return 'Refunding' case -97: return 'Hold' case -2: return 'Expired' case -1: return 'Failure' case 0: return 'Unpaid' case 1: return 'PaidConfirming' case 2: return 'Paid' default: break } } const bookingColor = status => { if (/Unpaid/.test(status)) { return "tw-text-error-default"; } if (/Failure/.test(status)) { return "tw-text-error-default"; } if (/Confirming/.test(status)) { return "tw-text-secondary-default"; } if (/Expired/.test(status)) { return "tw-text-neutrals-800"; } if (/Refunded/.test(status)) { return "tw-text-success-default"; } if (/Paid/.test(status)) { return "tw-text-success-default"; } if (/Partial Payment/.test(status)) { return "tw-text-secondary-default"; } if (/Considering/.test(status)) { return "tw-text-neutrals-800"; } if (/Confirmed/.test(status)) { return "tw-text-secondary-default"; } if (/Processing/.test(status)) { return "tw-text-secondary-default"; } if (/Completed/.test(status)) { return "tw-text-success-default"; } if (/Cancelled/.test(status)) { return "tw-text-neutrals-800"; } } export { bookingStatusMap, supplierStatusMap, paymentStatusMap, bookingColor }
|