@@ -22,6 +22,19 @@ import Avatar from '@/components/Avatar'
22
22
import { useConfig } from '#/state/application/hooks'
23
23
import { fromNow } from '@/utils/date'
24
24
25
+ const StatusBadge = ( { icon, color, text, borderColor, textColor } ) => {
26
+ return (
27
+ < div className = { `inline-flex items-center gap-2 ${ color } bg-opacity-10 rounded-full` } >
28
+ < span className = { `w-[24px] h-[24px] rounded-full flex items-center justify-center border-2 ${ borderColor } ` } >
29
+ { icon }
30
+ </ span >
31
+ < span className = { `text-xs font-semibold ${ textColor } font-nunito leading-[12px] text-left pr-2` } >
32
+ { text }
33
+ </ span >
34
+ </ div >
35
+ ) ;
36
+ } ;
37
+
25
38
export function BountiesCard ( { data } ) {
26
39
const config = useConfig ( )
27
40
const filters = config ?. find ( f => f . config_id === 1 ) ?. config_value [ 'bounty' ]
@@ -30,9 +43,7 @@ export function BountiesCard({ data }) {
30
43
href = { `/bounties/${ data . id } ` }
31
44
className = { `
32
45
group flex flex-col relative cursor-pointer overflow-hidden rounded-2xl
33
- bg-gradient-to-b ${
34
- data . status === 3 ? "from-[#E5E5FE] to-[#FFFFFF]" : "bg-white"
35
- }
46
+ bg-gradient-to-b ${ data . status === 3 ? 'from-[#E5E5FE] to-[#FFFFFF]' : 'bg-white' }
36
47
py-4 transition-all duration-300 ease-in-out hover:shadow-lg hover:-translate-y-2 [&>div]:px-4
37
48
` }
38
49
>
@@ -68,34 +79,13 @@ export function BountiesCard({ data }) {
68
79
< div className = "flex items-center gap-2" >
69
80
< div className = "flex items-center" >
70
81
{ data . status === 3 && (
71
- < div className = "flex items-center gap-2 bg-[#807DFB] bg-opacity-10 rounded-full" >
72
- < span className = "w-[24px] h-[24px] rounded-full flex items-center justify-center border-2 border-[#807DFB]" >
73
- 🧱
74
- </ span >
75
- < span className = "w-[65px] text-xs font-semibold text-[#807DFB] font-nunito leading-[12px] text-left" >
76
- Recruiting
77
- </ span >
78
- </ div >
82
+ < StatusBadge icon = "🧱" color = "bg-[#807DFB]" borderColor = "border-[#807DFB]" textColor = "text-[#807DFB]" text = "Recruiting" />
79
83
) }
80
84
{ data . status > 6 && data . status < 24 && (
81
- < div className = "flex items-center gap-2 bg-[#01DB83] bg-opacity-10 rounded-full" >
82
- < span className = "w-[24px] h-[24px] rounded-full flex items-center justify-center border-2 border-[#01DB83]" >
83
- 🔫
84
- </ span >
85
- < span className = "w-[54px] text-xs font-semibold text-[#00C475] font-nunito leading-[12px]" >
86
- Building
87
- </ span >
88
- </ div >
85
+ < StatusBadge icon = "🔫" color = "bg-[#01DB83]" borderColor = "border-[#01DB83]" textColor = "text-[#00C475]" text = "Building" />
89
86
) }
90
87
{ data . status === 30 && (
91
- < div className = "flex items-center gap-2 bg-[#82ADD8] bg-opacity-10 rounded-full" >
92
- < span className = "w-[24px] h-[24px] rounded-full flex items-center justify-center border-2 border-[#82ADD8]" >
93
- 🔚
94
- </ span >
95
- < span className = "w-[70px] text-xs font-semibold text-[#82ADD8] font-nunito leading-[12px] text-left" >
96
- Completed
97
- </ span >
98
- </ div >
88
+ < StatusBadge icon = "🔚" color = "bg-[#82ADD8]" borderColor = "border-[#82ADD8]" textColor = "text-[#82ADD8]" text = "Completed" />
99
89
) }
100
90
</ div >
101
91
</ div >
0 commit comments