"use client"; import { Check, X } from "lucide-react"; import { useState } from "react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Label } from "@/components/ui/label"; 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")} ریال`; const renderAnnualPrice = (price: number, discount?: number) => { if (!discount) { return formatPrice(price); } return ( {formatPrice(price)} {discount.toLocaleString("fa-IR")}٪- ); }; const plans = [ { title: "رایگان", description: "برای پروژه‌های متن‌باز", price: { monthly: 9, annually: 90000 }, href: "#", recommended: false, image: "/block-media/shadcnblocks/block/block-1.svg", featureGroups: [ { title: "خلاصه", features: [ { title: "۳ کاربر", icon: Check, }, ], }, { title: "برجسته‌ها", features: [ { title: "امکان شامل‌شده", icon: Check, }, { title: "امکان غیرفعال", icon: X, }, ], }, ], }, { title: "پایه", description: "برای پروژه‌های متن‌باز", price: { monthly: 50, annually: 450000, annualDiscount: 10 }, href: "#", recommended: false, image: "/block-media/shadcnblocks/block/block-2.svg", featureGroups: [ { title: "خلاصه", features: [ { title: "۱۰ کاربر", icon: Check, }, ], }, { title: "برجسته‌ها", features: [ { title: "امکان شامل‌شده", icon: Check, }, { title: "امکان غیرفعال", icon: X, }, ], }, ], }, { title: "تیم", description: "برای پروژه‌های متن‌باز", price: { monthly: 100, annually: 900000, annualDiscount: 10 }, href: "#", recommended: true, image: "/block-media/shadcnblocks/block/block-3.svg", featureGroups: [ { title: "خلاصه", features: [ { title: "۵۰ کاربر", icon: Check, }, ], }, { title: "برجسته‌ها", features: [ { title: "امکان شامل‌شده", icon: Check, }, { title: "امکان غیرفعال", icon: X, }, ], }, ], }, { title: "سازمانی", description: "برای پروژه‌های متن‌باز", price: { monthly: 200, annually: 160000, annualDiscount: 20 }, href: "#", recommended: false, image: "/block-media/shadcnblocks/block/block-4.svg", featureGroups: [ { title: "خلاصه", features: [ { title: "عضو نامحدود فضای کاری", icon: Check, }, ], }, { title: "برجسته‌ها", features: [ { title: "امکان شامل‌شده", icon: Check, }, { title: "امکان غیرفعال", icon: X, }, ], }, ], }, ]; interface Pricing10Props { className?: string; } const Pricing10 = ({ className }: Pricing10Props) => { const [annualBilling, setAnnualBilling] = useState(false); return (

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

طرح مناسب خود را انتخاب کنید و همین امروز شروع رایگان.

{plans.map((plan) => (
{plan.recommended && (
پیشنهادی
)}

{plan.title}

{plan.description}

{plan.title}

{annualBilling ? renderAnnualPrice( plan.price.annually, "annualDiscount" in plan.price ? plan.price.annualDiscount : undefined, ) : formatPrice(plan.price.monthly)}

در ماه

{plan.featureGroups.map((group) => (

{group.title}

    {group.features.map((feature) => (
  • {feature.title}
  • ))}
))}
))}
); }; export { Pricing10 };