import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Label } from "@/components/ui/label"; import { Switch } from "@/components/ui/switch"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { RefreshCw, CreditCard } from "lucide-react"; import { usePro } from "@/contexts/pro-context"; import { Alert, AlertDescription } from "@/components/ui/alert"; interface GeneralTabProps { settings: any; onSettingChange: (key: string, value: any) => void; saving: boolean; } export function GeneralTab({ settings, onSettingChange, saving }: GeneralTabProps) { const { isPro } = usePro(); return (
General Settings {saving && } Configure basic subscription settings

Allow subscription and non-subscription products in the same cart

onSettingChange('mixed_checkout', checked)} />

Show quantity field on subscription products (hidden by default)

onSettingChange('allow_quantity', checked)} />
Subscription Switching Allow customers to switch between subscription plans

Customers can upgrade or downgrade their subscription

onSettingChange('allow_switching', checked)} />
{settings.allow_switching && (

How to handle payments when customers switch plans

)}
{/* Synchronize Renewals - Pro Feature */} {isPro && ( Synchronize Renewals Align subscription renewals to a specific day

Align all subscription renewals to a specific day of the month

onSettingChange('sync_renewals', checked)} />
{settings.sync_renewals && (

All subscriptions will renew on this day

)}
)} {/* Payment Methods */} Payment Methods Configure which payment gateways can be used for subscriptions Subscriptions require a payment gateway that supports recurring payments or tokenization.
PayPal
Credit Card (Stripe)
{isPro && (
Other Gateways
)}
{/* Subscription Limits - Pro Feature */} {isPro && ( Subscription Limits Limit how many subscriptions customers can have

Limit customers to one active subscription at a time

onSettingChange('single_subscription_only', checked)} />
)} {/* Upgrade/Downgrade - Pro Feature */} {isPro && ( Upgrade/Downgrade Allow customers to change subscription plans

Allow customers to upgrade or downgrade their plan

onSettingChange('allow_plan_changes', checked)} />
{settings.allow_plan_changes && (

How to handle billing when customers change plans

)}
)}
); } function getOrdinalSuffix(n: number): string { const s = ['th', 'st', 'nd', 'rd']; const v = n % 100; return s[(v - 20) % 10] || s[v] || s[0]; }