"use client"; import { BadgeCheck } from "lucide-react"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Separator } from "@/components/ui/separator"; import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; import { cn } from "@/lib/utils"; const formatPrice = (value: string | number) => `${(typeof value === "string" ? Number(value) : value).toLocaleString("fa-IR")} ریال`; const PRICING_PLANS = [ { name: "طرح پایه", monthlyPrice: 0, yearlyPrice: 0, isCustom: false, period: { monthly: "در ماه / کاربر", yearly: "در سال / کاربر", }, description: { monthly: "مناسب افرادی که تازه شروع کرده‌اند. نیازی به کارت اعتباری نیست.", yearly: "مناسب افرادی که تازه شروع کرده‌اند. نیازی به کارت اعتباری نیست.", }, buttonText: "رایگان شروع رایگان", highlighted: false, features: [ "امکانات با دسترسی محدود", "پشتیبانی ایمیلی در ساعات کاری", "وبلاگ هفتگی", "۱۰۰ گیگابایت فضای ذخیره", "پشتیبانی از همه فریم‌ورک‌ها", ], }, { name: "طرح استاندارد", monthlyPrice: 200000, yearlyPrice: 200000, isCustom: false, period: { monthly: "در ماه / کاربر", yearly: "در سال / کاربر", }, description: { monthly: "مناسب کسب‌وکارهای کوچک در حال رشد. با ۳۰ روز آزمایش رایگان شروع رایگان.", yearly: "مناسب کسب‌وکارهای کوچک در حال رشد. ۱۶٪ کمتر نسبت به پرداخت ماهانه.", }, buttonText: "شروع رایگان", highlighted: true, features: [ "امکانات با دسترسی محدود", "پشتیبانی ایمیلی در ساعات کاری", "وبلاگ هفتگی", "۱۰۰ گیگابایت فضای ذخیره", "پشتیبانی از همه فریم‌ورک‌ها", ], }, { name: "طرح پریمیوم", monthlyPrice: null, yearlyPrice: null, isCustom: true, period: { monthly: "در ماه / کاربر", yearly: "در سال / کاربر", }, description: { monthly: "مناسب سازمان‌های بزرگ با نیازهای پیشرفته. برای دریافت پیشنهاد سفارشی با ما تماس بگیرید.", yearly: "مناسب سازمان‌های بزرگ با نیازهای پیشرفته. برای دریافت پیشنهاد سفارشی با ما تماس بگیرید.", }, buttonText: "شروع رایگان", highlighted: false, features: [ "امکانات با دسترسی محدود", "پشتیبانی ایمیلی در ساعات کاری", "وبلاگ هفتگی", "۱۰۰ گیگابایت فضای ذخیره", "پشتیبانی از همه فریم‌ورک‌ها", ], }, ]; interface Pricing34Props { className?: string; } const formatPlanPrice = ( price: number | null, isCustom: boolean, ) => { if (isCustom) { return "سفارشی"; } return formatPrice(price ?? 0); }; const Pricing34 = ({ className }: Pricing34Props) => { const [billingCycle, setBillingCycle] = useState("monthly"); return (

طرح‌های تعرفه ساده

{ if (value && value !== billingCycle) { setBillingCycle(value); } }} className="rounded-lg bg-muted p-1" > ماهانه سالانه
{PRICING_PLANS.map((plan, index) => ( {plan.name}
{formatPlanPrice( billingCycle === "monthly" ? plan.monthlyPrice : plan.yearlyPrice, plan.isCustom, )}
{billingCycle === "monthly" ? plan.period.monthly : plan.period.yearly}

{billingCycle === "monthly" ? plan.description.monthly : plan.description.yearly}

امکانات
    {plan.features.map((feature, idx) => (
  • {feature}
  • ))}
))}
); }; export { Pricing34 };