Initial import of 1407 block sources under blocks/
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
"use client";
|
||||
|
||||
import { ArrowRight, ChevronDown } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import type { CarouselApi } from "@/components/ui/carousel";
|
||||
import {
|
||||
Carousel,
|
||||
CarouselContent,
|
||||
CarouselItem,
|
||||
} from "@/components/ui/carousel";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const features = [
|
||||
{
|
||||
id: "feature-1",
|
||||
title: "تریگر رویداد",
|
||||
description:
|
||||
"با هر رویداد مثل ثبت فرم یا تغییر وضعیت، اقدام بعدی را خودکار اجرا کنید.",
|
||||
href: "#",
|
||||
image: "/block-media/shadcnblocks/block/placeholder-1.svg",
|
||||
},
|
||||
{
|
||||
id: "feature-2",
|
||||
title: "شرط هوشمند",
|
||||
description:
|
||||
"مسیر متفاوت برای شرایط مختلف تعریف کنید و تصمیمگیری را سریعتر کنید.",
|
||||
href: "#",
|
||||
image: "/block-media/shadcnblocks/block/placeholder-2.svg",
|
||||
},
|
||||
{
|
||||
id: "feature-3",
|
||||
title: "اعلان خودکار",
|
||||
description:
|
||||
"تیم را در لحظه از تغییر وضعیت باخبر کنید تا هیچ موردی رها نشود.",
|
||||
href: "#",
|
||||
image: "/block-media/shadcnblocks/block/placeholder-3.svg",
|
||||
},
|
||||
];
|
||||
|
||||
interface Feature70Props {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const Feature70 = ({ className }: Feature70Props) => {
|
||||
const [selection, setSelection] = useState(0);
|
||||
const [carouselApi, setCarouselApi] = useState<CarouselApi>();
|
||||
useEffect(() => {
|
||||
if (!carouselApi) {
|
||||
return;
|
||||
}
|
||||
carouselApi.scrollTo(selection);
|
||||
}, [carouselApi, selection]);
|
||||
useEffect(() => {
|
||||
if (!carouselApi) {
|
||||
return;
|
||||
}
|
||||
const updateSelection = () => {
|
||||
setSelection(carouselApi.selectedScrollSnap());
|
||||
};
|
||||
carouselApi.on("select", updateSelection);
|
||||
return () => {
|
||||
carouselApi.off("select", updateSelection);
|
||||
};
|
||||
}, [carouselApi]);
|
||||
return (
|
||||
<section dir="rtl" lang="fa" className={cn("py-32", className)}>
|
||||
<div className="container">
|
||||
<div className="flex flex-col gap-8 md:flex-row">
|
||||
<div className="aspect-5/6 overflow-clip rounded-3xl bg-accent">
|
||||
<Carousel
|
||||
setApi={setCarouselApi}
|
||||
className="h-full w-full [&>div]:h-full"
|
||||
opts={{ direction: "rtl" }}
|
||||
>
|
||||
<CarouselContent className="mx-0 h-full w-full">
|
||||
{features.map((feature) => (
|
||||
<CarouselItem key={feature.id} className="px-0">
|
||||
<img
|
||||
src={feature.image}
|
||||
alt={`نمای ${feature.title}`}
|
||||
className="h-full w-full object-cover object-center"
|
||||
/>
|
||||
</CarouselItem>
|
||||
))}
|
||||
</CarouselContent>
|
||||
</Carousel>
|
||||
</div>
|
||||
<div className="flex shrink-0 flex-col md:w-1/2 md:pe-8 lg:pe-24 lg:text-start 2xl:pe-32">
|
||||
<h2 className="mb-6 text-3xl font-bold text-pretty lg:text-2xll">
|
||||
فرایندها را استاندارد و سریع کنید
|
||||
</h2>
|
||||
<p className="mb-16 text-muted-foreground lg:text-xl">
|
||||
اتوماسیون را در کل سازمان یکپارچه کنید
|
||||
</p>
|
||||
<ul className="space-y-2">
|
||||
{features.map((feature, i) => (
|
||||
<li
|
||||
key={feature.id}
|
||||
className="group relative w-full cursor-pointer px-6 py-3 transition data-open:bg-accent"
|
||||
data-open={selection === i ? "true" : undefined}
|
||||
onClick={() => setSelection(i)}
|
||||
>
|
||||
<div className="flex items-center justify-between gap-x-2">
|
||||
<div className="text-sm font-semibold text-accent-foreground">
|
||||
{feature.title}
|
||||
</div>
|
||||
<div className="flex size-8 items-center justify-center rounded-full bg-accent text-accent-foreground group-hover:bg-primary group-hover:text-primary-foreground group-data-open:bg-primary group-data-open:text-primary-foreground">
|
||||
<ChevronDown className="size-4 shrink-0 transition-transform duration-200 group-data-open:rotate-180" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="hidden text-sm font-medium group-data-open:block">
|
||||
<p className="my-4 text-muted-foreground lg:my-6">
|
||||
{feature.description}
|
||||
</p>
|
||||
<a
|
||||
href={feature.href}
|
||||
className="group/link flex items-center pb-3 text-sm text-accent-foreground"
|
||||
>
|
||||
بیشتر بدانید
|
||||
<ArrowRight className="ms-2 size-4 transition-transform group-hover/link:translate-x-1 rtl:rotate-180 rtl:group-hover/link:-translate-x-1" />
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
export { Feature70 };
|
||||
Reference in New Issue
Block a user