@@ -15,36 +15,31 @@ export function Cards({
15
15
} ) {
16
16
return (
17
17
< div className = "grid grid-cols-2 mt-6 gap-4" >
18
- { items . map (
19
- ( {
20
- icon : Icon ,
21
- title ,
22
- link ,
23
- description = link . replace ( / ^ h t t p s ? : \/ \/ / , "" ) ,
24
- } ) => {
25
- const isExternal = link . startsWith ( "https://" )
26
- return (
27
- < Card
28
- key = { title }
29
- as = { isExternal ? "a" : NextLink }
30
- // @ts -expect-error
31
- href = { link }
32
- className = { clsx (
33
- "flex flex-col items-center" ,
34
- isExternal &&
35
- "relative after:content-['_↗'] after:font-sans after:absolute after:right-4 after:top-4" ,
36
- ) }
18
+ { items . map ( ( { icon : Icon , title , link , description } ) => {
19
+ const isExternal = link . startsWith ( "https://" )
20
+ return (
21
+ < Card
22
+ key = { title }
23
+ as = { isExternal ? "a" : NextLink }
24
+ // @ts -expect-error
25
+ href = { link }
26
+ className = { clsx (
27
+ "flex flex-col items-center" ,
28
+ isExternal &&
29
+ "relative after:content-['_↗'] after:font-sans after:absolute after:right-4 after:top-4" ,
30
+ ) }
31
+ >
32
+ { /* @ts -expect-error */ }
33
+ { typeof Icon === "function" ? < Icon className = "h-6" /> : Icon }
34
+ < b className = "mt-4 mb-2 text-lg text-center" > { title } </ b >
35
+ < span
36
+ className = { `text-xs md:text-sm text-center ${ description ? "" : " break-all" } ` }
37
37
>
38
- { /* @ts -expect-error */ }
39
- { typeof Icon === "function" ? < Icon className = "h-6" /> : Icon }
40
- < b className = "mt-4 mb-2 text-lg text-center" > { title } </ b >
41
- < span className = "text-xs md:text-sm text-center break-all" >
42
- { description }
43
- </ span >
44
- </ Card >
45
- )
46
- } ,
47
- ) }
38
+ { description ? description : link . replace ( / ^ h t t p s ? : \/ \/ / , "" ) }
39
+ </ span >
40
+ </ Card >
41
+ )
42
+ } ) }
48
43
</ div >
49
44
)
50
45
}
0 commit comments