From f99e0aba70efad0deb907d8e27f09fc9f527c8a4 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Fri, 17 Feb 2023 17:07:50 +0700
Subject: Refactor

---
 src/core/components/elements/Badge/Badge.jsx | 33 ++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 src/core/components/elements/Badge/Badge.jsx

(limited to 'src/core/components/elements/Badge/Badge.jsx')

diff --git a/src/core/components/elements/Badge/Badge.jsx b/src/core/components/elements/Badge/Badge.jsx
new file mode 100644
index 00000000..5d8ebd1c
--- /dev/null
+++ b/src/core/components/elements/Badge/Badge.jsx
@@ -0,0 +1,33 @@
+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
\ No newline at end of file
-- 
cgit v1.2.3


From f66b12fd1d0b83af0d7230d7b1565fbe00afbe3c Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 22 Feb 2023 11:03:34 +0700
Subject: prettier

---
 src/core/components/elements/Badge/Badge.jsx | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

(limited to 'src/core/components/elements/Badge/Badge.jsx')

diff --git a/src/core/components/elements/Badge/Badge.jsx b/src/core/components/elements/Badge/Badge.jsx
index 5d8ebd1c..5e22db1a 100644
--- a/src/core/components/elements/Badge/Badge.jsx
+++ b/src/core/components/elements/Badge/Badge.jsx
@@ -1,14 +1,7 @@
-const Badge = ({ 
-  children, 
-  type, 
-  ...props 
-}) => {
+const Badge = ({ children, type, ...props }) => {
   return (
-    <div 
-      { ...props }
-      className={`${badgeStyle(type)} ${props?.className}`}
-    >
-      { children }
+    <div {...props} className={`${badgeStyle(type)} ${props?.className}`}>
+      {children}
     </div>
   )
 }
@@ -30,4 +23,4 @@ const badgeStyle = (type) => {
   return className.join(' ')
 }
 
-export default Badge
\ No newline at end of file
+export default Badge
-- 
cgit v1.2.3


From ac3fdf7be9982e65d8f83a20bc487f8dd62e3bfc Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 22 Feb 2023 23:36:47 +0700
Subject: fix

---
 src/core/components/elements/Badge/Badge.jsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/core/components/elements/Badge/Badge.jsx')

diff --git a/src/core/components/elements/Badge/Badge.jsx b/src/core/components/elements/Badge/Badge.jsx
index 5e22db1a..e50cdc78 100644
--- a/src/core/components/elements/Badge/Badge.jsx
+++ b/src/core/components/elements/Badge/Badge.jsx
@@ -1,6 +1,9 @@
 const Badge = ({ children, type, ...props }) => {
   return (
-    <div {...props} className={`${badgeStyle(type)} ${props?.className}`}>
+    <div
+      {...props}
+      className={`${badgeStyle(type)} ${props?.className}`}
+    >
       {children}
     </div>
   )
-- 
cgit v1.2.3

