summaryrefslogtreecommitdiff
path: root/src/lib/transaction/components/TransactionStatusBadge.jsx
blob: cb8cbcd97447082abb1d06b7606849af7968db2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const TransactionStatusBadge = ({ status }) => {
  let badgeProps = {
    className: ['h-fit md:text-caption-2 whitespace-nowrap'],
    text: ''
  }
  switch (status) {
    case 'cancel':
      badgeProps.className.push('badge-solid-red')
      badgeProps.text = 'Pesanan Batal'
      break
    case 'draft':
      badgeProps.className.push('badge-red')
      badgeProps.text = 'Pending Quotation'
      break
    case 'waiting':
      badgeProps.className.push('badge-yellow')
      badgeProps.text = 'Pesanan Diproses'
      break
    case 'sale':
      badgeProps.className.push('badge-yellow')
      badgeProps.text = 'Pesanan Dikemas'
      break
    case 'shipping':
      badgeProps.className.push('badge-green')
      badgeProps.text = 'Pesanan Dikirim'
      break
    case 'partial_shipping':
      badgeProps.className.push('badge-green')
      badgeProps.text = 'Dikirim Sebagian'
      break
    case 'done':
      badgeProps.className.push('badge-solid-green')
      badgeProps.text = 'Pesanan selesai'
      break
  }
  badgeProps.className = badgeProps.className.join(' ')

  return <div className={badgeProps.className}>{badgeProps.text}</div>
}

export default TransactionStatusBadge