summaryrefslogtreecommitdiff
path: root/src/components/transactions/TransactionStatusBadge.js
blob: d8da60336e92c44c2a390f546326632d47a57bb3 (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'],
    text: ''
  };
  switch (status) {
    case 'cancel':
      badgeProps.className.push('badge-solid-red');
      badgeProps.text = 'Batal'
      break;
    case 'draft':
      badgeProps.className.push('badge-red');
      badgeProps.text = 'Pending Quotation'
      break;
    case 'waiting':
      badgeProps.className.push('badge-yellow');
      badgeProps.text = 'Dikonfirmasi'
      break;
    case 'sale':
      badgeProps.className.push('badge-yellow');
      badgeProps.text = 'Pesanan Diproses'
      break;
    case 'shipping':
      badgeProps.className.push('badge-green');
      badgeProps.text = 'Pesanan Dikirim'
      break;
    case 'done':
      badgeProps.className.push('badge-solid-green');
      badgeProps.text = 'Selesai'
      break;
  }
  badgeProps.className = badgeProps.className.join(' ');

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

export default TransactionStatusBadge;