"use client" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle, CardFooter } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Sparkles, Check } from "lucide-react" import { cn } from '@/lib/utils' export interface PricingPlan { id: string name: string description: string price: string frequency: string features: string[] popular?: boolean current?: boolean } interface PricingPlansProps { plans?: PricingPlan[] mode?: 'pricing' | 'billing' currentPlanId?: string onPlanSelect?: (planId: string) => void } const defaultPlans: PricingPlan[] = [ { id: 'basic', name: 'Basic', description: 'Perfect for small online stores', price: '$19', frequency: '/month', features: ['Up to 10 products', 'Basic inventory tracking', 'Email support', 'Mobile-responsive themes'], }, { id: 'professional', name: 'Professional', description: 'Ideal for growing businesses', price: '$79', frequency: '/month', features: [ 'Up to 100 products', 'Advanced analytics', 'Priority email & chat support', 'API access', 'Custom domain', 'Abandoned cart recovery', ], popular: true, }, { id: 'enterprise', name: 'Enterprise', description: 'For high-volume stores', price: '$199', frequency: '/month', features: [ 'Unlimited products', 'Advanced reporting', '24/7 priority support', 'Custom integrations', 'Dedicated account manager', 'Advanced security features', ], }, ] export function PricingPlans({ plans = defaultPlans, mode = 'pricing', currentPlanId, onPlanSelect }: PricingPlansProps) { const getButtonText = (plan: PricingPlan) => { if (mode === 'billing') { if (currentPlanId === plan.id) { return 'Current Plan' } const currentIndex = plans.findIndex(p => p.id === currentPlanId) const planIndex = plans.findIndex(p => p.id === plan.id) if (planIndex > currentIndex) { return 'Upgrade Plan' } else if (planIndex < currentIndex) { return 'Downgrade Plan' } } return 'Get Started' } const getButtonVariant = (plan: PricingPlan) => { if (mode === 'billing' && currentPlanId === plan.id) { return 'outline' as const } return plan.popular ? 'default' as const : 'outline' as const } const isButtonDisabled = (plan: PricingPlan) => { return mode === 'billing' && currentPlanId === plan.id } return (
{tier.description}