@@ -6,14 +6,15 @@ import {
6
6
FaXTwitter ,
7
7
FaYoutube ,
8
8
} from "react-icons/fa6"
9
- import { Icon } from "@chakra-ui/react"
10
9
11
- const socialColors = {
12
- reddit : "#ff4301" ,
13
- twitter : "#1da1f2" ,
14
- youtube : "#ff0000" ,
15
- discord : "#7289da" ,
16
- stackExchange : "#48a2da" ,
10
+ import { cn } from "@/lib/utils/cn"
11
+
12
+ const socialColorClasses = {
13
+ reddit : "text-[#ff4301]" ,
14
+ twitter : "text-[#1da1f2]" ,
15
+ youtube : "text-[#ff0000]" ,
16
+ discord : "text-[#7289da]" ,
17
+ stackExchange : "text-[#48a2da]" ,
17
18
}
18
19
19
20
const icons = {
@@ -25,28 +26,22 @@ const icons = {
25
26
webpage : FaGlobe ,
26
27
}
27
28
28
- type SocialListItemProps = {
29
- children ?: React . ReactNode
29
+ type SocialListItemProps = React . HTMLAttributes < HTMLDivElement > & {
30
30
socialIcon : keyof typeof icons
31
- color ?: string
32
- boxSize ?: number
33
31
}
34
32
35
33
const SocialListItem = ( {
36
34
children,
37
35
socialIcon,
38
- color,
39
- boxSize = 10 ,
40
- } : SocialListItemProps ) => (
41
- < div className = "flex w-full items-center px-0 py-2" >
42
- < Icon
43
- as = { icons [ socialIcon ] }
44
- pe = { 3 }
45
- boxSize = { boxSize }
46
- color = { color || socialColors [ socialIcon ] }
47
- />
48
- < div className = "font-normal italic" > { children } </ div >
49
- </ div >
50
- )
36
+ className,
37
+ } : SocialListItemProps ) => {
38
+ const Icon = icons [ socialIcon ]
39
+ return (
40
+ < div className = { cn ( "flex w-full items-center px-0 py-2" , className ) } >
41
+ < Icon className = { cn ( "size-10 pe-3" , socialColorClasses [ socialIcon ] ) } />
42
+ < div className = "font-normal italic" > { children } </ div >
43
+ </ div >
44
+ )
45
+ }
51
46
52
47
export default SocialListItem
0 commit comments