diff --git a/frontend/src/components/settings/LicenseSection.tsx b/frontend/src/components/settings/LicenseSection.tsx index bcaba916..849af469 100644 --- a/frontend/src/components/settings/LicenseSection.tsx +++ b/frontend/src/components/settings/LicenseSection.tsx @@ -5,22 +5,16 @@ import { toast } from '@/components/ui/toast-store'; import { useLicense } from '@/context/LicenseContext'; import { TierBadge } from '@/components/TierBadge'; import { - Crown, CheckCircle, Check, XCircle, Clock, ExternalLink, - CreditCard, RefreshCw, Zap, Compass, ShipWheel, Loader2, + Crown, CheckCircle, XCircle, Clock, ExternalLink, + CreditCard, RefreshCw, Loader2, } from 'lucide-react'; import { apiFetch } from '@/lib/api'; import { SettingsSection } from './SettingsSection'; import { SettingsField } from './SettingsField'; -import { SettingsCallout } from './SettingsCallout'; import { SettingsActions, SettingsPrimaryButton } from './SettingsActions'; import { useMastheadStats } from './MastheadStatsContext'; -// Lemon Squeezy hosted checkout URLs. Admiral monthly and annual include a built-in -// 14-day trial (email + card required on LS checkout); users receive a license key -// by email and paste it into the activate input below. -const SKIPPER_CHECKOUT_URL = 'https://saelix.lemonsqueezy.com/checkout/buy/f75bfb65-443a-46a0-abb1-981e0ff4b382'; -const ADMIRAL_MONTHLY_CHECKOUT_URL = 'https://saelix.lemonsqueezy.com/checkout/buy/b049b824-176a-408d-a9d3-9365c979a61f'; -const ADMIRAL_ANNUAL_CHECKOUT_URL = 'https://saelix.lemonsqueezy.com/checkout/buy/3e595568-92d3-4edd-90f1-25650248dfa9'; +const PRICING_URL = 'https://sencho.io/pricing'; function getTierDisplayName(tier?: string, variant?: string | null, status?: string): string { if (tier === 'paid' && variant === 'admiral' && status === 'active') return 'Sencho Admiral'; @@ -59,11 +53,11 @@ export function LicenseSection() { } }; - const isAdmiral = isPaid && license?.variant === 'admiral' && license?.status === 'active'; - const showSkipperCard = !isPaid || license?.status === 'trial'; - const showTrialCta = license?.status !== 'active' && license?.status !== 'trial'; - const showAdmiralUpgradeCard = !isAdmiral && !showTrialCta; - const showUpgradeCards = showSkipperCard || showAdmiralUpgradeCard; + // Pricing link covers two cases: Community-tier operators evaluating + // a paid plan, and expired paid licensees who need a path back. Active + // and trial paid licensees already manage their plan through the + // billing portal in the Plan section above. + const showPricingLink = !isPaid || license?.status === 'expired'; const renewsValue = useMemo(() => { if (!license) return null; @@ -219,113 +213,6 @@ export function LicenseSection() { ) : null} - {showTrialCta ? ( - -
- } - title="14 days, full Admiral" - subtitle="Host Console, Scheduled Operations, LDAP / Active Directory, audit log, API tokens, and unlimited accounts. Lemon Squeezy needs a card; cancel any time before day 14." - /> -
- window.open(ADMIRAL_MONTHLY_CHECKOUT_URL, '_blank')} - > - Start monthly trial - - - -
-

- ⓘ paste the license key from your email into the activate field below -

-
-
- ) : null} - - {showUpgradeCards ? ( - -
- {showSkipperCard ? ( - } - title="Skipper" - blurb="Professional tools for solo operators." - features={[ - 'Fleet View with drill-down', - 'Viewer accounts (1 admin + 3 viewers)', - 'Webhooks & stack labels', - 'Atomic deployments & backups', - 'Auto-update policies', - 'Google / GitHub / Okta SSO', - ]} - action={ - window.open(SKIPPER_CHECKOUT_URL, '_blank')} - > - - Get Skipper - - - } - /> - ) : null} - {showAdmiralUpgradeCard ? ( - } - title="Admiral" - blurb="For teams managing shared infrastructure." - features={[ - ...(license?.variant === 'skipper' ? ['Everything in Skipper'] : ['Everything in Community']), - 'Unlimited accounts & scoped RBAC', - ...(license?.variant !== 'skipper' ? ['Fleet View, webhooks & labels', 'Atomic deployments & backups'] : []), - 'LDAP/AD, audit log & host console', - 'API tokens & private registries', - 'Scheduled operations', - ]} - action={ - showSkipperCard ? ( - - ) : ( - window.open(ADMIRAL_MONTHLY_CHECKOUT_URL, '_blank')} - > - - Get Admiral - - - ) - } - /> - ) : null} -
-
- ) : null} - {license?.status !== 'active' ? ( ) : null} - - ); -} - -interface UpgradeCardProps { - tone: 'warn' | 'brand'; - icon: React.ReactNode; - title: string; - blurb: string; - features: string[]; - action: React.ReactNode; -} - -function UpgradeCard({ tone, icon, title, blurb, features, action }: UpgradeCardProps) { - const iconClass = tone === 'warn' ? 'text-warning' : 'text-brand'; - return ( -
-
- {icon} - {title} -
-

{blurb}

- -
{action}
+ + {showPricingLink ? ( + +
+ +
+
+ ) : null}
); }