2024-02-11 22:46:44 +04:00
|
|
|
---
|
2024-02-18 07:40:53 +04:00
|
|
|
// Import the necessary dependencies
|
2024-02-11 22:46:44 +04:00
|
|
|
import { Image } from "astro:assets";
|
2024-02-20 08:43:57 +04:00
|
|
|
import heroImage from "../../../images/hero-image.avif";
|
2024-02-20 07:51:14 +04:00
|
|
|
import PrimaryCTA from "../../ui/buttons/PrimaryCTA.astro";
|
|
|
|
|
import SecondaryCTA from "../../ui/buttons/SecondaryCTA.astro";
|
2024-02-27 06:15:35 +04:00
|
|
|
import ReviewComponent from "../../ui/blocks/ReviewComponent.astro";
|
2024-02-11 22:46:44 +04:00
|
|
|
|
2024-02-20 07:47:23 +04:00
|
|
|
// Define props from Astro
|
|
|
|
|
const {
|
|
|
|
|
title,
|
|
|
|
|
subTitle,
|
|
|
|
|
primaryBtn,
|
|
|
|
|
primaryBtnURL,
|
|
|
|
|
secondaryBtn,
|
|
|
|
|
secondaryBtnURL,
|
|
|
|
|
withReview,
|
2024-02-21 22:01:09 +04:00
|
|
|
avatars,
|
2024-02-27 06:15:35 +04:00
|
|
|
starCount,
|
2024-02-20 07:47:23 +04:00
|
|
|
rating,
|
2024-02-21 22:01:09 +04:00
|
|
|
reviews
|
2024-02-20 07:47:23 +04:00
|
|
|
} = Astro.props;
|
|
|
|
|
|
|
|
|
|
// Define TypeScript interface for props
|
|
|
|
|
interface Props {
|
|
|
|
|
title: string;
|
|
|
|
|
subTitle?: string;
|
|
|
|
|
primaryBtn?: string;
|
|
|
|
|
primaryBtnURL?: string;
|
|
|
|
|
secondaryBtn?: string;
|
|
|
|
|
secondaryBtnURL?: string;
|
|
|
|
|
withReview?: boolean;
|
2024-02-21 22:01:09 +04:00
|
|
|
avatars?: Array<string>;
|
2024-02-20 07:47:23 +04:00
|
|
|
starCount?: number;
|
|
|
|
|
rating?: string;
|
|
|
|
|
reviews?: string;
|
|
|
|
|
}
|
2024-02-11 22:46:44 +04:00
|
|
|
---
|
|
|
|
|
|
2024-02-18 07:40:53 +04:00
|
|
|
<!-- Defining a grid container that holds all the content -->
|
2024-02-19 09:36:37 +04:00
|
|
|
<section
|
2024-02-11 22:46:44 +04:00
|
|
|
class="mx-auto grid max-w-[85rem] gap-4 px-4 py-14 sm:px-6 md:grid-cols-2 md:items-center md:gap-8 lg:px-8 2xl:max-w-full"
|
|
|
|
|
>
|
|
|
|
|
<!-- Title and description -->
|
|
|
|
|
<div>
|
2024-02-18 07:40:53 +04:00
|
|
|
<!-- Each h1 and p tag renders a portion of the title and subTitle defined above -->
|
2024-02-11 22:46:44 +04:00
|
|
|
<h1
|
2024-02-18 07:40:53 +04:00
|
|
|
class="block text-balance text-3xl font-bold tracking-tight text-neutral-800 dark:text-neutral-200 sm:text-4xl lg:text-6xl lg:leading-tight"
|
2024-02-11 22:46:44 +04:00
|
|
|
>
|
|
|
|
|
<!-- About Fragment: https://docs.astro.build/en/basics/astro-syntax/#fragments -->
|
|
|
|
|
<Fragment set:html={title} />
|
|
|
|
|
</h1>
|
2024-02-21 22:01:09 +04:00
|
|
|
{subTitle &&
|
2024-02-11 22:46:44 +04:00
|
|
|
<p
|
|
|
|
|
class="mt-3 text-pretty text-lg leading-relaxed text-neutral-700 dark:text-neutral-400 lg:w-4/5"
|
|
|
|
|
>
|
|
|
|
|
{subTitle}
|
|
|
|
|
</p>
|
2024-02-21 22:01:09 +04:00
|
|
|
}
|
2024-02-18 07:40:53 +04:00
|
|
|
<!-- Action Button Section: This section includes two CTAs with their own styles and URL -->
|
2024-02-11 22:46:44 +04:00
|
|
|
<div class="mt-7 grid w-full gap-3 sm:inline-flex">
|
2024-02-21 22:01:09 +04:00
|
|
|
{primaryBtn &&
|
2024-02-11 22:46:44 +04:00
|
|
|
<PrimaryCTA title={primaryBtn} url={primaryBtnURL} />
|
2024-02-21 22:01:09 +04:00
|
|
|
}
|
|
|
|
|
{secondaryBtn &&
|
2024-02-11 22:46:44 +04:00
|
|
|
<SecondaryCTA title={secondaryBtn} url={secondaryBtnURL} />
|
2024-02-21 22:01:09 +04:00
|
|
|
}
|
2024-02-11 22:46:44 +04:00
|
|
|
</div>
|
|
|
|
|
|
2024-02-18 07:40:53 +04:00
|
|
|
<!-- Review Section: This section presents avatars, review ratings and the number of reviews -->
|
2024-02-20 07:47:23 +04:00
|
|
|
{ withReview ? (
|
2024-02-27 06:15:35 +04:00
|
|
|
<ReviewComponent avatars={avatars} starCount={starCount} rating={rating} reviews={reviews} />
|
|
|
|
|
) : "" }
|
2024-02-11 22:46:44 +04:00
|
|
|
|
2024-02-27 06:15:35 +04:00
|
|
|
</div>
|
2024-02-18 07:40:53 +04:00
|
|
|
<!-- Hero Image Section -->
|
2024-02-11 22:46:44 +04:00
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="top-12 overflow-hidden">
|
|
|
|
|
<Image
|
|
|
|
|
src={heroImage}
|
2024-02-13 05:50:53 +04:00
|
|
|
alt="Stack of ScrewFast product boxes containing assorted hardware tools"
|
2024-02-12 07:36:55 +04:00
|
|
|
class="h-full w-full scale-110 object-cover object-center"
|
2024-02-11 22:46:44 +04:00
|
|
|
draggable={"false"}
|
2024-02-13 05:50:53 +04:00
|
|
|
loading={"eager"}
|
|
|
|
|
format={"avif"}
|
2024-02-11 22:46:44 +04:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-02-19 09:36:37 +04:00
|
|
|
</section>
|