import React from 'react'; import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography, Box, Alert, Paper } from '@mui/material'; import { CreditCard, Warning, ArrowForward } from '@mui/icons-material'; interface SubscriptionExpiredModalProps { open: boolean; onClose: () => void; onRenewSubscription: () => void; subscriptionData?: { plan?: string; tier?: string; limits?: any; } | null; errorData?: { provider?: string; usage_info?: any; message?: string; } | null; } const SubscriptionExpiredModal: React.FC = ({ open, onClose, onRenewSubscription, subscriptionData, errorData }) => { const handleRenewClick = () => { onRenewSubscription(); onClose(); }; return ( {errorData?.usage_info ? 'Usage Limit Reached' : 'Subscription Expired'} } > {errorData?.usage_info ? 'You\'ve reached your API usage limit' : 'Your subscription has expired'} {errorData?.message || (errorData?.usage_info ? 'You\'ve reached your monthly usage limit for this plan. Upgrade your plan to get higher limits.' : 'To continue using Alwrity and access all features, you need to renew your subscription.' )} {errorData?.usage_info && ( Usage Information: {errorData.usage_info.call_usage_percentage && ( You've used {errorData.usage_info.call_usage_percentage.toFixed(1)}% of your monthly limit )} {errorData.provider && ( Provider: {errorData.provider} )} )} {subscriptionData && ( {subscriptionData.plan && ( Current Plan: {subscriptionData.plan} )} {subscriptionData.tier && subscriptionData.tier !== subscriptionData.plan && ( Tier: {subscriptionData.tier} )} )} Renewing your subscription will restore access to: ✓ AI Content Generation ✓ Website Analysis ✓ Research Tools ✓ All Premium Features ); }; export default SubscriptionExpiredModal;