summaryrefslogtreecommitdiff
path: root/src/core/components/elements/Badge/Badge.jsx
blob: 5e22db1acff314902e86a0bedb714c74894171e3 (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
const Badge = ({ children, type, ...props }) => {
  return (
    <div {...props} className={`${badgeStyle(type)} ${props?.className}`}>
      {children}
    </div>
  )
}

Badge.defaultProps = {
  className: ''
}

const badgeStyle = (type) => {
  let className = ['rounded px-1 text-[11px]']
  switch (type) {
    case 'solid-red':
      className.push('bg-red_r-11 text-white')
      break
    case 'light':
      className.push('bg-gray_r-4 text-gray_r-11')
      break
  }
  return className.join(' ')
}

export default Badge