2024-02-11 23:55:40 +04:00
|
|
|
---
|
2024-02-18 07:39:53 +04:00
|
|
|
// Import the necessary dependencies
|
2024-02-11 23:55:40 +04:00
|
|
|
import { Image } from "astro:assets";
|
2024-04-17 18:25:49 +04:00
|
|
|
import IconBlock from "@components/ui/blocks/IconBlock.astro";
|
|
|
|
|
import Icon from "@components/ui/icons/Icon.astro";
|
2024-02-11 23:55:40 +04:00
|
|
|
|
2024-03-22 04:43:19 +04:00
|
|
|
interface Feature {
|
|
|
|
|
heading: string;
|
|
|
|
|
content: string;
|
|
|
|
|
svg: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
title?: string;
|
|
|
|
|
subTitle?: string;
|
|
|
|
|
features?: Feature[];
|
|
|
|
|
src?: any;
|
|
|
|
|
alt?: string;
|
|
|
|
|
}
|
|
|
|
|
// Define props from Astro
|
|
|
|
|
const { title, subTitle, src, alt, features } = Astro.props;
|
2024-02-11 23:55:40 +04:00
|
|
|
---
|
|
|
|
|
|
2024-02-19 09:36:37 +04:00
|
|
|
<section
|
2024-02-11 23:55:40 +04:00
|
|
|
class="mx-auto max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full"
|
|
|
|
|
>
|
2024-02-18 07:39:53 +04:00
|
|
|
<!-- Block to display the feature image -->
|
2024-02-11 23:55:40 +04:00
|
|
|
<div class="relative mb-6 overflow-hidden md:mb-8">
|
2024-03-22 04:43:19 +04:00
|
|
|
{
|
|
|
|
|
src && alt && (
|
|
|
|
|
<Image
|
|
|
|
|
src={src}
|
|
|
|
|
alt={alt}
|
|
|
|
|
class="h-full w-full object-cover object-center"
|
|
|
|
|
draggable={"false"}
|
|
|
|
|
format={"avif"}
|
|
|
|
|
loading={"eager"}
|
|
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|
2024-02-11 23:55:40 +04:00
|
|
|
</div>
|
|
|
|
|
|
2024-02-18 07:39:53 +04:00
|
|
|
<!-- Displaying the main content consisting of title, subtitle, and several `IconBlock` components -->
|
2024-02-11 23:55:40 +04:00
|
|
|
<div class="mt-5 grid gap-8 lg:mt-16 lg:grid-cols-3 lg:gap-12">
|
2024-02-18 07:39:53 +04:00
|
|
|
<!-- Block for title and subtitle -->
|
2024-02-11 23:55:40 +04:00
|
|
|
<div class="lg:col-span-1">
|
2024-02-18 07:39:53 +04:00
|
|
|
<!-- Rendering title -->
|
2024-02-11 23:55:40 +04:00
|
|
|
<h2
|
2024-02-13 05:50:53 +04:00
|
|
|
class="text-balance text-2xl font-bold text-neutral-800 dark:text-neutral-200 md:text-3xl"
|
2024-02-11 23:55:40 +04:00
|
|
|
>
|
|
|
|
|
{title}
|
|
|
|
|
</h2>
|
2024-02-18 07:39:53 +04:00
|
|
|
<!-- Rendering subtitle -->
|
2024-03-22 04:43:19 +04:00
|
|
|
{
|
|
|
|
|
subTitle && (
|
|
|
|
|
<p class="mt-2 text-pretty text-neutral-600 dark:text-neutral-400 md:mt-4">
|
|
|
|
|
{subTitle}
|
|
|
|
|
</p>
|
|
|
|
|
)
|
2024-02-22 21:59:24 +04:00
|
|
|
}
|
2024-02-11 23:55:40 +04:00
|
|
|
</div>
|
|
|
|
|
|
2024-02-18 07:39:53 +04:00
|
|
|
<!-- Block to display the IconBlock components -->
|
2024-02-11 23:55:40 +04:00
|
|
|
<div class="lg:col-span-2">
|
|
|
|
|
<div class="grid gap-8 sm:grid-cols-2 md:gap-12">
|
2024-02-18 07:39:53 +04:00
|
|
|
<!-- Injecting IconBlock components with different properties -->
|
2024-03-22 04:43:19 +04:00
|
|
|
{ features &&
|
|
|
|
|
features.map((feature) => (
|
|
|
|
|
<IconBlock heading={feature.heading} content={feature.content}>
|
|
|
|
|
<Icon name={feature.svg} />
|
|
|
|
|
</IconBlock>
|
|
|
|
|
))
|
|
|
|
|
}
|
2024-02-11 23:55:40 +04:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-02-19 09:36:37 +04:00
|
|
|
</section>
|