/** * Pro Upgrade Components * * Reusable components for showing upgrade prompts */ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { Badge } from "@/components/ui/badge" import { Crown, Sparkles, Lock, ArrowRight, CheckCircle2, Zap, Shield, Headphones } from "lucide-react" import { usePro } from "@/contexts/pro-context" interface ProBadgeProps { className?: string } /** * Golden "PRO" badge with crown icon - always shows in golden/amber style * Used to indicate Pro features throughout the app */ export function ProBadge({ className = "" }: ProBadgeProps) { return ( Pro ) } interface ProFeatureLockProps { feature: string description?: string children?: React.ReactNode } /** * Overlay for locked Pro features */ export function ProFeatureLock({ feature, description, children }: ProFeatureLockProps) { const { isPro, upgradeUrl } = usePro() if (isPro) { return <>{children} } const handleUpgrade = () => { window.open(upgradeUrl, '_blank') } return (
{children && (
{children}
)}
{feature} {description && ( {description} )}
) } interface UpgradeCardProps { title?: string description?: string features?: string[] compact?: boolean } /** * Upgrade prompt card */ export function UpgradeCard({ title = "Unlock Pro Features", description = "Get access to advanced features with Swift Commerce Pro", features = [], compact = false }: UpgradeCardProps) { const { upgradeUrl } = usePro() const handleUpgrade = () => { window.open(upgradeUrl, '_blank') } if (compact) { return (

{title}

{description}

) } return (
{title} {description}
{features.length > 0 && ( )}
30-day money back Priority support
) } interface ProFeatureListProps { features: Array<{ name: string description: string icon?: React.ReactNode }> } /** * List of Pro features */ export function ProFeatureList({ features }: ProFeatureListProps) { const { upgradeUrl } = usePro() const handleUpgrade = () => { window.open(upgradeUrl, '_blank') } return (
Pro Features
Unlock these powerful features with Swift Commerce Pro
{features.map((feature, index) => (
{feature.icon || }

{feature.name}

{feature.description}

))}
) } /** * Inline Pro upgrade prompt (for use next to limited features) */ export function InlineUpgradePrompt({ message }: { message: string }) { const { upgradeUrl } = usePro() const handleUpgrade = () => { window.open(upgradeUrl, '_blank') } return (
{message}
) } import { ReactNode } from "react" import { BookOpen, ExternalLink } from "lucide-react" import { cn } from "@/lib/utils" interface LockedFeaturePageProps { /** Icon component to display */ icon: ReactNode /** Feature title */ title: string /** Feature description */ description: string /** Documentation URL - opens in new tab */ documentationUrl: string /** UpgradeCard title */ upgradeTitle: string /** UpgradeCard description */ upgradeDescription: string /** Features list for UpgradeCard */ features: string[] } /** * Full-page layout for locked Pro features * Uses same header style as FeatureHeader for consistency */ export function LockedFeaturePage({ icon, title, description, documentationUrl, upgradeTitle, upgradeDescription, features, }: LockedFeaturePageProps) { const handleDocumentationClick = () => { window.open(documentationUrl, '_blank', 'noopener,noreferrer') } return (
{/* Sticky Header - matching FeatureHeader style */}
{/* Top Row: Icon, Title, Description + Actions */}
{/* Left side: Icon + Title + Description */}
{icon}

{title}

{description}

{/* Right side: Actions */}
{/* Content */}
) }