Initial import of 1407 block sources under blocks/
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,143 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
|
||||
import {
|
||||
Accordion,
|
||||
AccordionContent,
|
||||
AccordionItem,
|
||||
AccordionTrigger,
|
||||
} from "@/components/ui/accordion";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
interface FeatureItem {
|
||||
id: number;
|
||||
title: string;
|
||||
image: string;
|
||||
imageAlt: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
const DEFAULT_FEATURES: FeatureItem[] = [
|
||||
{
|
||||
id: 1,
|
||||
title: "مدیریت دارایی",
|
||||
image: "/block-media/shadcnblocks/block/lummi/bw12.jpeg",
|
||||
imageAlt: "گزارش مالی یکپارچه",
|
||||
description:
|
||||
"درخواست خرید تا سفارش تأمینکننده را در یک مسیر مدیریت کنید.",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "بودجهبندی",
|
||||
image: "/block-media/shadcnblocks/block/lummi/bw15.jpeg",
|
||||
imageAlt: "داشبورد ERP",
|
||||
description:
|
||||
"فاکتور را سریع صادر کنید و وضعیت تسویه را شفاف ببینید.",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "مدیریت مالی",
|
||||
image: "/block-media/shadcnblocks/block/lummi/bw20.jpeg",
|
||||
imageAlt: "مدیریت عملیات",
|
||||
description:
|
||||
"درآمد و هزینه را در یک دفتر کل متمرکز دنبال کنید.",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: "کنترل موجودی",
|
||||
image: "/block-media/shadcnblocks/block/lummi/bw21.jpeg",
|
||||
imageAlt: "گزارش مالی یکپارچه",
|
||||
description:
|
||||
"ورود و خروج کالا را لحظهای ثبت کنید و اختلاف انبار را کم کنید.",
|
||||
},
|
||||
];
|
||||
|
||||
interface Feature197Props {
|
||||
features?: FeatureItem[];
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const Feature197 = ({
|
||||
features = DEFAULT_FEATURES,
|
||||
className,
|
||||
}: Feature197Props) => {
|
||||
const [activeTabId, setActiveTabId] = useState<number | null>(1);
|
||||
const [activeImage, setActiveImage] = useState(features[0].image);
|
||||
|
||||
return (
|
||||
<section dir="rtl" lang="fa" className={cn("py-32", className)}>
|
||||
<div className="container mx-auto">
|
||||
<h2 className="mb-12 text-3xl font-semibold text-balance md:text-xl">
|
||||
عملیات سازمان را یکپارچه کنید
|
||||
</h2>
|
||||
<div className="flex w-full items-start justify-between gap-12">
|
||||
<div className="w-full md:w-1/2">
|
||||
<Accordion
|
||||
type="single"
|
||||
collapsible
|
||||
className="w-full"
|
||||
defaultValue="item-1"
|
||||
>
|
||||
{features.map((tab) => (
|
||||
<AccordionItem
|
||||
key={tab.id}
|
||||
value={`item-${tab.id}`}
|
||||
className="transition-opacity hover:opacity-80"
|
||||
>
|
||||
<AccordionTrigger
|
||||
onClick={() => {
|
||||
setActiveImage(tab.image);
|
||||
setActiveTabId(tab.id);
|
||||
}}
|
||||
className="cursor-pointer py-5 text-start no-underline! transition"
|
||||
>
|
||||
<span
|
||||
className={cn(
|
||||
"text-xl",
|
||||
tab.id === activeTabId
|
||||
? "text-foreground"
|
||||
: "text-muted-foreground",
|
||||
)}
|
||||
>
|
||||
{tab.title}
|
||||
</span>
|
||||
</AccordionTrigger>
|
||||
<AccordionContent className="pb-2">
|
||||
<p className="text-base text-pretty text-muted-foreground">
|
||||
{tab.description}
|
||||
</p>
|
||||
<div className="mt-4 md:hidden">
|
||||
<img
|
||||
src={tab.image}
|
||||
alt={tab.imageAlt}
|
||||
className="h-full max-h-80 w-full rounded-md object-cover"
|
||||
/>
|
||||
</div>
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
))}
|
||||
</Accordion>
|
||||
</div>
|
||||
<div className="relative hidden w-1/2 overflow-hidden rounded-xl bg-muted md:block">
|
||||
<div className="relative aspect-4/3">
|
||||
{features.map((feature) => (
|
||||
<img
|
||||
key={feature.id}
|
||||
src={feature.image}
|
||||
alt={feature.imageAlt}
|
||||
className={cn(
|
||||
"absolute inset-0 h-full w-full rounded-md object-cover transition-opacity duration-500",
|
||||
activeImage === feature.image ? "opacity-100" : "opacity-0",
|
||||
)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
export { Feature197 };
|
||||
Reference in New Issue
Block a user