import React from 'react'; import { Box, Card, CardActions, CardContent, Chip, Typography, List, ListItem, ListItemIcon, ListItemText, Divider, IconButton, Button, CircularProgress, Tooltip, } from '@mui/material'; import { Check as CheckIcon, Star as StarIcon, WorkspacePremium as PremiumIcon, Info as InfoIcon, Psychology, Search as SearchIcon, Edit, Assistant, Verified, Timeline, Analytics, Support, Business, Group, } from '@mui/icons-material'; import MenuBookIcon from '@mui/icons-material/MenuBook'; import ImageIcon from '@mui/icons-material/Image'; import VideoIcon from '@mui/icons-material/VideoLibrary'; import AudioIcon from '@mui/icons-material/Audiotrack'; import { useTheme } from '@mui/material/styles'; interface SubscriptionPlan { id: number; name: string; tier: string; price_monthly: number; price_yearly: number; description: string; features: string[]; limits: { gemini_calls: number; openai_calls: number; anthropic_calls: number; mistral_calls: number; tavily_calls: number; serper_calls: number; metaphor_calls: number; firecrawl_calls: number; stability_calls: number; monthly_cost: number; image_edit_calls?: number; video_calls?: number; audio_calls?: number; ai_text_generation_calls_limit?: number; }; } interface PlanCardProps { plan: SubscriptionPlan; yearlyBilling: boolean; selectedPlanId: number | null; subscribing: boolean; onSelectPlan: (planId: number) => void; onSubscribe: (planId: number) => void; openKnowMoreModal: (title: string, content: React.ReactNode) => void; } const PlanCard: React.FC = ({ plan, yearlyBilling, selectedPlanId, subscribing, onSelectPlan, onSubscribe, openKnowMoreModal, }) => { const theme = useTheme(); const getPlanIcon = (tier: string) => { switch (tier) { case 'free': return ; case 'basic': return ; case 'pro': return ; case 'enterprise': return ; default: return ; } }; const getPlanColor = (tier: string) => { switch (tier) { case 'free': return 'success' as const; case 'basic': return 'primary' as const; case 'pro': return 'secondary' as const; case 'enterprise': return 'warning' as const; default: return undefined; } }; const isSelected = selectedPlanId === plan.id; return ( {plan.tier === 'pro' && ( )} {getPlanIcon(plan.tier)} {plan.name} {plan.description} ${yearlyBilling ? plan.price_yearly : plan.price_monthly} /{yearlyBilling ? 'year' : 'month'} {yearlyBilling && ( Save ${(plan.price_monthly * 12 - plan.price_yearly).toFixed(0)} yearly )} {(plan.tier === 'free' || plan.tier === 'basic') && ( <> ✨ All ALwrity Tools Included: openKnowMoreModal( 'Blog Writer', Blog Writer Create engaging blog posts with AI assistance. Includes SEO optimization, keyword research, and content structure suggestions. Features: • SEO-optimized content generation • Keyword research integration • Content structure suggestions • Publishing assistance , ) } > openKnowMoreModal( 'LinkedIn Writer', LinkedIn Writer Create professional LinkedIn posts, articles, and carousels that engage your network and showcase your expertise. Features: • Professional post generation • Article writing assistance • Carousel creation • Network engagement optimization , ) } > openKnowMoreModal( 'Facebook Writer', Facebook Writer Create engaging Facebook posts, stories, and reels that drive engagement and grow your community. Features: • Post and story creation • Reel script generation • Community management • Engagement optimization , ) } > )} {(plan.tier === 'free' || plan.tier === 'pro' || plan.tier === 'enterprise') && ( <> Platform Integrations: openKnowMoreModal( 'Wix Integration', Wix Integration Seamlessly publish your content directly to Wix websites. No manual copying required. Features: • Direct blog post publishing • SEO metadata sync • Image optimization • Publishing queue management , ) } > openKnowMoreModal( 'WordPress Integration', WordPress Integration Connect directly to WordPress sites for seamless content publishing. Features: • REST API integration • Draft and publish modes • Category and tag management • Featured image handling , ) } > openKnowMoreModal( 'Google Search Console', Google Search Console Monitor your website's SEO performance and get actionable insights for content optimization. Features: • Search performance tracking • Keyword ranking insights • Technical SEO monitoring • Content optimization suggestions , ) } > )} {(plan.tier === 'pro' || plan.tier === 'enterprise') && ( <> Social Media & Website Management: openKnowMoreModal( '6 Major Social Platforms', 6 Major Social Platforms Comprehensive social media management across all major platforms with AI-powered content optimization. Features: • Cross-platform scheduling • Content performance insights • Engagement analytics • Platform-specific optimization , ) } > )} openKnowMoreModal( 'Text Generation', AI Text Generation Generate high-quality text content with AI assistance. From blog posts to social media updates, create engaging content effortlessly. Capabilities: • Blog posts and articles • Social media content • Email newsletters • Marketing copy {(plan.tier === 'pro' || plan.tier === 'enterprise') && ( <> • Audio transcription • Video script writing )} , ) } > openKnowMoreModal( 'Image Generation', AI Image Generation Create stunning visuals with AI-powered image generation. Perfect for social media, blog posts, and marketing materials. Capabilities: • Social media graphics • Blog featured images • Marketing visuals • Custom illustrations {(plan.tier === 'pro' || plan.tier === 'enterprise') && ( <> • Video thumbnail generation • Animated graphics )} , ) } > {(plan.tier === 'basic' || plan.tier === 'pro' || plan.tier === 'enterprise') && ( <> )} {plan.tier !== 'free' && ( <> Support & Analytics: {plan.tier === 'pro' && ( )} {plan.tier === 'enterprise' && ( <> )} )} Monthly Usage Limits: {plan.tier === 'basic' && ( )} {plan.tier !== 'basic' && ( <> {plan.limits.gemini_calls > 0 && ( )} {plan.limits.openai_calls > 0 && ( )} )} {plan.limits.stability_calls > 0 && ( )} {(plan.limits.image_edit_calls ?? 0) > 0 && ( )} {(plan.limits.video_calls ?? 0) > 0 && ( )} {(plan.limits.audio_calls ?? 0) > 0 && ( )} {plan.limits.tavily_calls > 0 && ( )} {plan.limits.monthly_cost > 0 && ( )} {plan.tier === 'basic' && ( Powered by Open-Source AI Models We use cost-effective open-source models to give you more value. 25-50% savings vs proprietary models. )} {plan.tier === 'pro' ? ( ) : plan.tier === 'enterprise' ? ( ) : ( <> {isSelected && ( )} )} ); }; export default PlanCard;