File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- const { name, description } = Astro .props ;
2+ const { name, description, subsections } = Astro .props ;
3+
4+ interface ISubsection {
5+ name: string ;
6+ description: string ;
7+ }
38---
49
5- <div class =" bg-stone-100 rounded-lg p-6 flex flex-col gap-4" >
10+ <div class ={ ` bg-stone-100 rounded-lg p-6 flex flex-col gap-4 ${ subsections ? ' sm:col-span-2 md:col-span-2 ' : ' ' } ` } >
611 <h3 class =" text-xl" >{ name } </h3 >
7- <p >{ description } </p >
12+
13+ { description && <p >{ description } </p >}
14+
15+ { subsections && subsections .length > 0 && (
16+ <div class = " grid grid-cols-1 sm:grid-cols-2 gap-2 mt-2 h-full" >
17+ { subsections .map ((sub : ISubsection ) => (
18+ <div class = " bg-white rounded-lg p-4 flex flex-col gap-2" >
19+ <h4 class = " text-lg font-medium" >{ sub .name } </h4 >
20+ <p class = " text-sm" >{ sub .description } </p >
21+ </div >
22+ ))}
23+ </div >
24+ )}
825</div >
You can’t perform that action at this time.
0 commit comments