11---
2- import classnames from " classnames" ;
32import { Image } from " astro:assets" ;
3+ import classnames from " classnames" ;
4+ import BlogLink from " ./BlogLink.astro" ;
5+ import CTA from " ./CTA.astro" ;
6+ import IconSubtitle from " ./IconSubtitle.astro" ;
47
58interface Props {
69 idx: number ;
710 title: string ;
8- subtitle: string ;
11+ subtitles: Array <{
12+ iconPath: string ;
13+ text: string ;
14+ }>;
915 content: any ;
1016 styles? : string ;
11- imgPath: string ;
12- imgAlt: string ;
13- iconPath: string ;
17+ img: {
18+ path: string ;
19+ alt? : string ;
20+ };
1421 classNames? : string | string [];
22+ link: {
23+ href: string ;
24+ text: string ;
25+ title? : string ;
26+ };
1527}
1628
17- const {
18- title,
19- subtitle,
20- content,
21- styles,
22- imgPath,
23- imgAlt,
24- iconPath,
25- classNames,
26- } = Astro .props ;
29+ const { title, subtitles, content, styles, img, classNames, link } =
30+ Astro .props ;
2731
2832const images = import .meta .glob (" ../assets/*.*" );
29- const src = images [` ../assets${imgPath } ` ] as any as () => Promise <{
33+ const src = images [` ../assets${img . path } ` ] as any as () => Promise <{
3034 default: ImageMetadata ;
3135}>;
3236
@@ -53,7 +57,6 @@ const image = await src();
5357 class ={ classnames (
5458 ` text-white
5559 h-full
56- lg:h-[620px]
5760 p-5
5861 md:p-7
5962 lg:p-12
@@ -65,7 +68,6 @@ const image = await src();
6568 lg:gap-x-7
6669 lg:gap-y-12
6770 lg:grid-cols-2
68- lg:grid-rows-[min-content_auto]
6971 backdrop-blur-[15px]
7072 ` ,
7173 classNames ,
@@ -74,38 +76,59 @@ const image = await src();
7476 <div
7577 class =" col-span-6 grid max-lg:grid-rows-[min-content_min-content_auto] gap-4 md:gap-7 lg:grid-cols-2 lg:col-span-2 lg:items-start justify-between"
7678 >
77- <span class =" grid md:flex gap-4 md:gap-7" >
78- <img
79- src ={ iconPath }
80- alt =" "
81- role =" presentation"
82- class =" lg:mt-[2px] h-8 w-8 md:h-12 md:w-12"
79+ <h2
80+ class =" font-medium text-xl sm:text-[28px] md:text-5xl text-left leading-[110%] lg:col-start-1 lg:row-start-1"
81+ >
82+ { title }
83+ </h2 >
84+
85+ <div class =" flex flex-col gap-4 md:gap-9 lg:row-span-2" >
86+ <div class =" grid md:grid-cols-2 gap-4" >
87+ {
88+ subtitles .map (({ iconPath , text }) => (
89+ <IconSubtitle subtitle = { text } iconPath = { iconPath } />
90+ ))
91+ }
92+ </div >
93+ <div
94+ class =" [&_p]:text-sm [&_p]:leading-[26px] sm:[&_p]:text-base md:[&_p]:text-[20px] md:[&_p]:font-normal md:[&_p]:leading-8 text-left"
95+ set:html ={ content .html }
8396 />
84- <div class =" gap-y-2 flex flex-col" >
85- <h4
86- class =" font-medium text-lg leading-[22px] md:text-[28px] md:leading-[30px] text-left"
87- >
88- { title }
89- </h4 >
90- <p class =" text-base md:text-lg" >{ subtitle } </p >
97+ <div >
98+ {
99+ link ?.title ? (
100+ <BlogLink
101+ href = { link .href }
102+ title = { link .title }
103+ linkText = { link .text }
104+ />
105+ ) : (
106+ <CTA id = " contact-cta" href = { link .href } >
107+ { link .text }
108+ <img
109+ src = { " arrow-top-right.svg" }
110+ alt = " Arrow Top Right"
111+ role = " presentation"
112+ class = " hidden min-[330px]:block h-3 w-3 sm:h-4 sm:w-4"
113+ />
114+ </CTA >
115+ )
116+ }
91117 </div >
92- </span >
118+ </div >
119+
93120 <div
94- class =" flex flex-col justify-center items-center row-start-3 lg:justify-start lg:col-span -1 lg:row-start-2"
121+ class =" flex flex-col justify-center items-center lg:justify-start lg:col-start -1 lg:row-start-2"
95122 >
96123 <Image
97124 class =" object-cover w-full max-lg:max-w-[640px] xl:p-6"
98125 src ={ image .default }
99- alt ={ imgAlt }
126+ alt ={ img . alt || " " }
100127 widths ={ [320 , 480 , 578 , 640 ]}
101128 sizes =" (max-width: 1024px) calc(100vw - 56px), 640px"
102129 loading =" lazy"
103130 />
104131 </div >
105- <div
106- class =" flex flex-col lg:flex-col row-start-2 lg:col-span-1 lg:col-start-2 lg:row-span-2 [&_p]:text-base [&_p]:text-sm [&_p]:leading-[26px] md:[&_p]:text-[20px] md:[&_p]:font-normal md:[&_p]:leading-8 text-left"
107- set:html ={ content .html }
108- />
109132 </div >
110133 </section >
111134</div >
0 commit comments