@@ -6,51 +6,54 @@ import Badge from "@site/src/components/Common/Badge";
6
6
import isInternalUrl from "@docusaurus/isInternalUrl" ;
7
7
8
8
export interface CardWithImageHorizontalProps {
9
- title : string ;
10
- description : ReactNode ;
11
- imgSrc : string ;
12
- imgAlt ?: string ;
13
- url ?: string ;
14
- buttonVariant ?: ButtonVariant ;
15
- ctaLabel ?: string ;
16
- iconName ?: IconName ;
9
+ title : string ;
10
+ description : ReactNode ;
11
+ imgSrc : string ;
12
+ imgAlt ?: string ;
13
+ url ?: string ;
14
+ buttonVariant ?: ButtonVariant ;
15
+ ctaLabel ?: string ;
16
+ iconName ?: IconName ;
17
17
}
18
18
19
19
export default function CardWithImageHorizontal ( {
20
- title,
21
- description,
22
- imgSrc,
23
- imgAlt = "" ,
24
- url,
25
- buttonVariant = "secondary" ,
26
- ctaLabel = "Read now" ,
27
- iconName,
20
+ title,
21
+ description,
22
+ imgSrc,
23
+ imgAlt = "" ,
24
+ url,
25
+ buttonVariant = "secondary" ,
26
+ ctaLabel = "Read now" ,
28
27
} : CardWithImageHorizontalProps ) {
29
- return (
30
- < div className = "card group !grid [grid-template-columns:repeat(auto-fit,minmax(15rem,1fr))] items-center gap-4 overflow-hidden rounded-2xl border border-black/10 dark:border-white/10 bg-muted/40 p-4 transition-colors" >
31
- < div className = "aspect-[400/209] overflow-hidden rounded-xl relative flex items-center" >
32
- < img
33
- src = { imgSrc }
34
- alt = { imgAlt }
35
- className = "pointer-events-none w-full h-auto object-contain transition-transform origin-bottom duration-500 group-hover:scale-105"
36
- />
37
- { url && ! isInternalUrl ( url ) && (
38
- < Badge className = "absolute top-2 right-2" variant = "default" size = "sm" >
39
- External
40
- </ Badge >
41
- ) }
42
- </ div >
43
- < div className = "flex flex-col min-w-0 justify-center gap-1" >
44
- < Heading as = "h4" className = "!mb-1" >
45
- { title }
46
- </ Heading >
47
- < p className = "!mb-3 text-sm" > { description } </ p >
48
- { url && (
49
- < Button variant = { buttonVariant } url = { url } >
50
- { ctaLabel }
51
- </ Button >
52
- ) }
53
- </ div >
54
- </ div >
55
- ) ;
56
- }
28
+ return (
29
+ < div className = "card group !grid grid-cols-1 xl:grid-cols-[minmax(10rem,_230px)_1fr] 2xl:grid-cols-[minmax(10rem,_270px)_1fr] items-center gap-4 overflow-hidden rounded-2xl border border-black/10 dark:border-white/10 bg-muted/40 p-4 transition-colors" >
30
+ < div className = "aspect-[537/281] overflow-hidden rounded-xl relative flex items-center" >
31
+ < img
32
+ src = { imgSrc }
33
+ alt = { imgAlt }
34
+ className = "pointer-events-none w-full h-auto object-contain transition-transform origin-bottom duration-500 group-hover:scale-105"
35
+ />
36
+ { url && ! isInternalUrl ( url ) && (
37
+ < Badge
38
+ className = "absolute top-2 right-2"
39
+ variant = "default"
40
+ size = "sm"
41
+ >
42
+ External
43
+ </ Badge >
44
+ ) }
45
+ </ div >
46
+ < div className = "flex flex-col min-w-0 justify-center gap-1" >
47
+ < Heading as = "h4" className = "!mb-1" >
48
+ { title }
49
+ </ Heading >
50
+ < p className = "!mb-3 text-sm" > { description } </ p >
51
+ { url && (
52
+ < Button variant = { buttonVariant } url = { url } >
53
+ { ctaLabel }
54
+ </ Button >
55
+ ) }
56
+ </ div >
57
+ </ div >
58
+ ) ;
59
+ }
0 commit comments