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 { RefreshCw, Info, Calendar } from "lucide-react"; import { Alert, AlertDescription } from "@/components/ui/alert"; import { usePro } from "@/contexts/pro-context"; interface CustomerTabProps { settings: any; onSettingChange: (key: string, value: any) => void; saving: boolean; } export function CustomerTab({ settings, onSettingChange, saving }: CustomerTabProps) { const { isPro } = usePro(); return (
Customer Self-Service {saving && } Allow customers to manage their subscriptions from their account Customers can manage their subscriptions from the "Subscriptions" tab in their My Account page.

Customers can temporarily pause their subscription

onSettingChange('customer_suspend', checked)} />
{settings.customer_suspend && (
onSettingChange('max_suspensions', parseInt(e.target.value))} className="max-w-[200px]" />

Maximum number of times a customer can pause their subscription. Set to 0 for unlimited.

)}

Customers can cancel their subscription themselves

onSettingChange('customer_cancel', checked)} />
{/* Customer Early Renewal - Pro Feature */} {isPro && ( Early Renewal Allow customers to renew their subscription before the renewal date

Customers can renew their subscription before the renewal date

onSettingChange('allow_early_renewal', checked)} />
{settings.allow_early_renewal && (
onSettingChange('early_renewal_days', parseInt(e.target.value))} />

Number of days before renewal that customers can renew early

)}
)} {isPro && ( Subscription Management by Customer Additional controls available to how customers can manage their subscriptions

View Subscription Details

Customers can view their subscription status, next payment date, and billing history.

Update Payment Method

Customers can update the payment method used for their subscription.

Manual Renewal

Customers with manual renewal subscriptions can pay for renewals from their account.

Resume Subscription

Customers can resume paused subscriptions when ready.

)}
); }