"use client"; import { Check } from "lucide-react"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; import { Switch } from "@/components/ui/switch"; import { cn } from "@/lib/utils"; const formatPrice = (value: string | number) => `${(typeof value === "string" ? Number(value) : value).toLocaleString("fa-IR")} ریال`; interface Plan { id: string; name: string; monthlyPrice: number; yearlyPrice: number; description?: string; features: string[]; highlighted?: boolean; ctaText?: string; ctaHref?: string; } interface Pricing41Props { heading?: string; description?: string; plans?: Plan[]; className?: string; } const Pricing41 = ({ heading = "تعرفه‌ها", description = "رایگان با کل تیم خود استفاده کنید. با ارتقای طرح، موارد کاری نامحدود، کنترل‌های امنیتی پیشرفته و امکانات بیشتر را فعال کنید.", plans = [ { id: "free", name: "رایگان", monthlyPrice: 0, yearlyPrice: 0, description: "رایگان برای همه", features: [ "اعضای نامحدود", "۲ تیم", "۵۰۰ مورد کاری", "یکپارچه‌سازی پیام‌رسان تیمی و مخزن کد", ], ctaText: "شروع رایگان", ctaHref: "#", }, { id: "startup", name: "استارتاپ", monthlyPrice: 80000, yearlyPrice: 60000, features: [ "همه امکانات طرح رایگان، به‌علاوه:", "دستیار هوش مصنوعی", "تیم‌های نامحدود", "موارد کاری و آپلود فایل نامحدود", "بینش‌های پیشرفته", "نقش‌های مدیریتی", ], highlighted: true, ctaText: "شروع رایگان", ctaHref: "#", }, { id: "enterprise", name: "سازمانی", monthlyPrice: 240000, yearlyPrice: 200000, features: [ "همه امکانات طرح استارتاپ، به‌علاوه:", "هوش مصنوعی پیشرفته", "ورود یکپارچه (SSO) و احراز هویت سازمانی", "پشتیبانی اختصاصی", "یکپارچه‌سازی‌های سفارشی", ], ctaText: "گفتگو با فروش", ctaHref: "#", }, ], className, }: Pricing41Props) => { const [isAnnual, setIsAnnual] = useState(true); return (

{heading}

{description}

{plans.map((plan) => (

{plan.name}

{formatPrice( isAnnual ? plan.yearlyPrice : plan.monthlyPrice, )}{" "} {plan.id !== "free" && ( به ازای هر کاربر در{" "} {isAnnual ? "سال" : "ماه"} )}
{plan.id !== "free" ? (
setIsAnnual(!isAnnual)} aria-label="تغییر صورتحساب سالانه" /> صورتحساب سالانه
) : ( {plan.description} )}
{plan.features.map((feature) => (
{feature}
))}
))}
); }; export { Pricing41 };