"use client"; import { Check } from "lucide-react"; import { useState } from "react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Separator } from "@/components/ui/separator"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { cn } from "@/lib/utils"; const formatPrice = (value: string | number) => `${(typeof value === "string" ? Number(value) : value).toLocaleString("fa-IR")} ریال`; interface PricingPlan { name: string; badge: string; monthlyPrice: number; yearlyPrice: number; features: string[]; buttonText: string; isPopular?: boolean; } interface Pricing4Props { title?: string; description?: string; plans?: PricingPlan[]; className?: string; } const Pricing4 = ({ title = "تعرفه‌ها", description = "طرح‌های مقرون‌به‌صرفه ما را ببینید.", plans = [ { name: "رایگان", badge: "رایگان", monthlyPrice: 0, yearlyPrice: 0, features: [ "یکپارچه‌سازی نامحدود", "پشتیبانی از ویندوز، لینوکس و مک", "پشتیبانی اولویت‌دار", "به‌روزرسانی رایگان", ], buttonText: "شروع رایگان", }, { name: "حرفه‌ای", badge: "حرفه‌ای", monthlyPrice: 290000, yearlyPrice: 249000, features: [ "همه‌چیز در رایگان", "پشتیبانی تماس زنده ماهانه", "فضای فایل نامحدود", ], buttonText: "خرید", }, { name: "الیت", badge: "الیت", monthlyPrice: 590000, yearlyPrice: 549000, features: [ "همه‌چیز در حرفه‌ای", "تحلیل‌های پیشرفته", "برندسازی سفارشی", "عضو نامحدود فضای کاری", ], buttonText: "خرید", isPopular: true, }, ], className, }: Pricing4Props) => { const [isAnnually, setIsAnnually] = useState(false); return (

{title}

{description}

setIsAnnually(value === "annually") } className="w-fit shrink-0" aria-label="دوره صورتحساب" > ماهانه سالانه
{plans.map((plan) => (
{plan.badge}

{formatPrice( isAnnually ? plan.yearlyPrice : plan.monthlyPrice, )}

{isAnnually ? "در سال" : "در ماه"}

    {plan.features.map((feature, featureIndex) => (
  • ))}
))}
); }; export { Pricing4 };