stacker.news/components/invoice-status.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

2021-05-13 13:28:38 +00:00
import Moon from '../svgs/moon-fill.svg'
import Check from '../svgs/check-double-line.svg'
2021-05-13 21:19:51 +00:00
import ThumbDown from '../svgs/thumb-down-fill.svg'
2021-05-13 13:28:38 +00:00
function InvoiceDefaultStatus ({ status }) {
return (
<div className='d-flex mt-2'>
<Moon className='spin fill-grey' />
<div className='ml-3 text-muted' style={{ fontWeight: '600' }}>{status}</div>
</div>
)
}
function InvoiceConfirmedStatus ({ status }) {
return (
<div className='d-flex mt-2'>
<Check className='fill-success' />
<div className='ml-3 text-success' style={{ fontWeight: '600' }}>{status}</div>
</div>
)
}
function InvoiceFailedStatus ({ status }) {
return (
<div className='d-flex mt-2'>
2021-05-13 21:19:51 +00:00
<ThumbDown className='fill-danger' />
2021-05-13 13:28:38 +00:00
<div className='ml-3 text-danger' style={{ fontWeight: '600' }}>{status}</div>
</div>
)
}
export default function InvoiceStatus ({ variant, status }) {
switch (variant) {
case 'confirmed':
return <InvoiceConfirmedStatus status={status} />
case 'failed':
return <InvoiceFailedStatus status={status} />
default:
return <InvoiceDefaultStatus status={status} />
}
}