11---
2- import type { Content as Props } from ' ~/types' ;
2+ import { Icon } from ' astro-icon/components' ;
3+ import Button from ' ~/components/ui/Button.astro' ;
34import Headline from ' ~/components/ui/Headline.astro' ;
45import WidgetWrapper from ' ~/components/ui/WidgetWrapper.astro' ;
56import Image from ' ~/components/common/Image.astro' ;
6- import Button from ' ~/components/ui/Button.astro' ;
7- import ItemGrid from ' ~/components/ui/ItemGrid.astro' ;
7+ import type { Content as Props } from ' ~/types' ;
88
99const {
1010 title = await Astro .slots .render (' title' ),
@@ -23,6 +23,15 @@ const {
2323 classes = {},
2424 bg = await Astro .slots .render (' bg' ),
2525} = Astro .props ;
26+
27+ const columnsClass =
28+ columns === 4
29+ ? ' lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2'
30+ : columns === 3
31+ ? ' lg:grid-cols-3 sm:grid-cols-2'
32+ : columns === 2
33+ ? ' sm:grid-cols-2'
34+ : ' ' ;
2635---
2736
2837<WidgetWrapper
@@ -54,19 +63,47 @@ const {
5463 )
5564 }
5665
57- <ItemGrid
58- items ={ items }
59- columns ={ columns }
60- defaultIcon =" tabler:check"
61- classes ={ {
62- container: ` gap-y-4 md:gap-y-8 ` ,
63- panel: ' max-w-none' ,
64- title: ' text-lg font-medium leading-6 dark:text-white ml-2 rtl:ml-0 rtl:mr-2' ,
65- description: ' text-muted dark:text-slate-400 ml-2 rtl:ml-0 rtl:mr-2' ,
66- icon: ' flex h-7 w-7 items-center justify-center rounded-full bg-green-600 dark:bg-green-700 text-gray-50 p-1' ,
67- action: ' text-lg font-medium leading-6 dark:text-white ml-2 rtl:ml-0 rtl:mr-2' ,
68- }}
69- />
66+ {
67+ items .length > 0 && (
68+ <div class :list = { [' grid mx-auto gap-y-4 md:gap-y-8 gap-8' , columnsClass ]} >
69+ { items .map (({ title : itemTitle , description , icon , callToAction }) => (
70+ <div class = " intersect-once motion-safe:md:opacity-0 motion-safe:md:intersect:animate-fade" >
71+ <div class = " flex flex-row max-w-none" >
72+ <div class = " flex justify-center" >
73+ <Icon
74+ name = { icon || ' tabler:check' }
75+ class = " flex h-7 w-7 items-center justify-center rounded-full bg-green-600 dark:bg-green-700 text-gray-50 p-1 mr-2 rtl:mr-0 rtl:ml-2"
76+ />
77+ </div >
78+ <div class = " mt-0.5" >
79+ { itemTitle && (
80+ <h3 class = " text-lg font-medium leading-6 dark:text-white ml-2 rtl:ml-0 rtl:mr-2" >
81+ { itemTitle }
82+ </h3 >
83+ )}
84+ { description && (
85+ <p
86+ class :list = { [{ ' mt-3' : itemTitle }, ' text-muted dark:text-slate-400 ml-2 rtl:ml-0 rtl:mr-2' ]}
87+ set :html = { description }
88+ />
89+ )}
90+ { callToAction && (
91+ <div
92+ class :list = { [
93+ { ' mt-3' : itemTitle || description },
94+ ' text-lg font-medium leading-6 dark:text-white ml-2 rtl:ml-0 rtl:mr-2' ,
95+ ]}
96+ >
97+ <Button variant = " link" { ... callToAction } />
98+ </div >
99+ )}
100+ </div >
101+ </div >
102+ </div >
103+ ))}
104+ </div >
105+ )
106+ }
70107 </div >
71108 <div aria-hidden =" true" class =" mt-10 md:mt-0 md:basis-1/2" >
72109 {
0 commit comments