1
+ import Link from "next/link" ;
2
+
1
3
type IntegrationCardProps = {
2
4
href : string ;
3
5
icon : React . ReactNode ;
4
6
title : string ;
5
7
description : string ;
6
8
colorScheme ?: "blue" | "green" | "purple" ;
9
+ external ?: boolean ;
10
+ showArrow ?: boolean ;
7
11
} ;
8
12
9
13
const colorClasses = {
@@ -24,33 +28,44 @@ const colorClasses = {
24
28
} ,
25
29
} ;
26
30
27
- export const IntegrationCard = ( {
31
+ export function IntegrationCard ( {
28
32
href,
29
33
icon,
30
34
title,
31
35
description,
32
36
colorScheme = "blue" ,
33
- } : IntegrationCardProps ) => {
37
+ external,
38
+ showArrow = true ,
39
+ } : IntegrationCardProps ) {
34
40
const colors = colorClasses [ colorScheme ] ;
41
+ const Wrapper = external ? "a" : Link ;
42
+ const wrapperProps = external
43
+ ? { href, target : "_blank" , rel : "noopener noreferrer" }
44
+ : { href } ;
35
45
36
46
return (
37
- < a
38
- href = { href }
39
- className = "block group bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg p-6 hover:border-gray-300 dark:hover:border-gray-600 transition-colors"
47
+ < Wrapper
48
+ { ...( wrapperProps as { href : string } | { href : string ; target : string ; rel : string } ) }
49
+ className = "not-prose group no-underline grid h-full grid-rows-[auto_1fr] gap-3 rounded-xl border bg-[var(--color-fd-card)] border-[var(--color-fd-border)] p-5 md:p-6 shadow-sm outline-none transition-colors hover:border-[var(--color-fd-accent)] focus-visible:ring-2 focus-visible:ring-[var(--color-fd-accent)]"
50
+ aria-label = { title }
40
51
>
41
- < div className = "flex items-center gap-3 mb-3 " >
52
+ < div className = "flex items-center gap-3" >
42
53
< div
43
- className = { `w -8 h -8 rounded-lg ${ colors . bg } flex items-center justify-center ` }
54
+ className = { `flex h -8 w -8 items-center justify-center rounded-md ${ colors . bg } ` }
44
55
>
45
- < div className = { `w -4 h -4 ${ colors . text } ` } > { icon } </ div >
56
+ < div className = { `h -4 w -4 ${ colors . text } ` } > { icon } </ div >
46
57
</ div >
47
- < h3
48
- className = { `text-lg font-semibold text-gray-900 dark:text-white ${ colors . hoverText } ` }
49
- >
50
- { title }
51
- </ h3 >
58
+ < h3 className = { `m-0 text-base font-semibold text-[var(--color-fd-foreground)] ${ colors . hoverText } ` } > { title } </ h3 >
59
+ { showArrow && (
60
+ < span
61
+ className = "ml-auto translate-x-0 opacity-0 transition-all duration-200 ease-out group-hover:translate-x-1 group-hover:opacity-100"
62
+ aria-hidden = "true"
63
+ >
64
+ →
65
+ </ span >
66
+ ) }
52
67
</ div >
53
- < p className = "text-gray-600 dark: text-gray-400 " > { description } </ p >
54
- </ a >
68
+ < p className = "m-0 text-sm text-[var(--color-fd-muted-foreground)] line-clamp-2 " > { description } </ p >
69
+ </ Wrapper >
55
70
) ;
56
- } ;
71
+ }
0 commit comments