import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Label } from "@/components/ui/label"; import { Input } from "@/components/ui/input"; import { Switch } from "@/components/ui/switch"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { AlertTriangle, Zap } from "lucide-react"; import { Alert, AlertDescription } from "@/components/ui/alert"; interface RenewalsTabProps { settings: any; onSettingChange: (key: string, value: any) => void; saving: boolean; } export function RenewalsTab({ settings, onSettingChange }: RenewalsTabProps) { return (
{/* Failed Payment Handling */} Failed Payment Handling Configure what happens when a renewal payment fails

Action to take when a renewal payment fails

Automatically retry failed payments

onSettingChange('retry_failed_payments', checked)} />
{settings.retry_failed_payments && ( <>
onSettingChange('retry_interval_days', parseInt(e.target.value))} />

Days between retry attempts

onSettingChange('max_failed_payments', parseInt(e.target.value))} />

Maximum number of retry attempts

After {settings.max_failed_payments} failed attempts, the subscription will be {settings.failed_payment_action === 'cancel' ? ' cancelled' : ' put on hold'} automatically. )}
{/* Force Renewal Button */} Force Renewal Button Add a "Renew Now" button to customer's My Account page

Show a "Renew Now" button for active subscriptions

onSettingChange('enable_renew_now_button', checked)} />
{/* Auto-Suspend on Failed Payment */} Auto-Suspend on Failed Payment Automatically suspend subscriptions after payment failures

Immediately suspend access when payment fails

onSettingChange('auto_suspend_on_failure', checked)} />

Automatically restore access when payment is received

onSettingChange('auto_restore_on_payment', checked)} />
); }