1+ import Link from "next/link" ;
2+
13type IntegrationCardProps = {
24 href : string ;
35 icon : React . ReactNode ;
46 title : string ;
57 description : string ;
68 colorScheme ?: "blue" | "green" | "purple" ;
9+ external ?: boolean ;
10+ showArrow ?: boolean ;
711} ;
812
913const colorClasses = {
@@ -24,33 +28,44 @@ const colorClasses = {
2428 } ,
2529} ;
2630
27- export const IntegrationCard = ( {
31+ export function IntegrationCard ( {
2832 href,
2933 icon,
3034 title,
3135 description,
3236 colorScheme = "blue" ,
33- } : IntegrationCardProps ) => {
37+ external,
38+ showArrow = true ,
39+ } : IntegrationCardProps ) {
3440 const colors = colorClasses [ colorScheme ] ;
41+ const Wrapper = external ? "a" : Link ;
42+ const wrapperProps = external
43+ ? { href, target : "_blank" , rel : "noopener noreferrer" }
44+ : { href } ;
3545
3646 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 }
4051 >
41- < div className = "flex items-center gap-3 mb-3 " >
52+ < div className = "flex items-center gap-3" >
4253 < 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 } ` }
4455 >
45- < div className = { `w -4 h -4 ${ colors . text } ` } > { icon } </ div >
56+ < div className = { `h -4 w -4 ${ colors . text } ` } > { icon } </ div >
4657 </ 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+ ) }
5267 </ 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 >
5570 ) ;
56- } ;
71+ }
0 commit comments