import { Link } from '@tanstack/react-router' import { ArrowRightIcon, ArrowUpRightIcon, CalendarIcon, CheckIcon, GaugeIcon, KeyRoundIcon, NetworkIcon, type LucideIcon, } from 'lucide-react' import type { ReactNode } from 'react' import { Button } from 'ui' import { MicroComputeUpgradeCard } from './MicroComputeUpgradeCard' import { FullScreenPanel } from './PlanUpdatePanelShell' import { ProPlanBenefits, TeamPlanBenefits } from './PlanUpgradeBenefits' import { getLinkProjectRef, type UpgradedPlanId } from './PlanUpgradeSuccess.utils' import type { OrgProject } from '@/data/projects/org-projects-infinite-query' const TEAM_BOOK_SUCCESS_ENGINEERING_URL = 'https://forms.supabase.com/teamtier' const PLAN_NAMES: Record = { pro: 'Pro', team: 'Team' } const NextStep = ({ icon: Icon, title, description, children, }: { icon: LucideIcon title: string description: ReactNode /** Actions for this step. */ children: ReactNode }) => (
  • {children}
  • ) const Section = ({ title, children }: { title: string; children: ReactNode }) => (

    {title}

    {children}
    ) interface PlanUpgradeSuccessViewProps { planId: UpgradedPlanId /** The plan the organization was on before upgrading. Unknown when the screen is opened by URL. */ previousPlanId?: string organizationName: string | undefined organizationSlug: string projects: OrgProject[] /** The org caps usage at its plan limits instead of billing for it. Pro plan only. */ isSpendCapEnabled: boolean onManageSpendCap: () => void onClose: () => void } /** * Shown after an upgrade to Pro or Team: what the plan includes now, and what to set up next. * Mirrors the welcome email for each plan, plus a push to move Nano projects to Micro. */ export const PlanUpgradeSuccessView = ({ planId, previousPlanId = planId === 'pro' ? 'free' : 'pro', organizationName, organizationSlug, projects, isSpendCapEnabled, onManageSpendCap, onClose, }: PlanUpgradeSuccessViewProps) => { const planName = PLAN_NAMES[planId] // Skipping Pro means none of its features have been unlocked yet, so Team lists them too. const isTeamFromFree = planId === 'team' && previousPlanId === 'free' // Pro's setup steps apply to anyone coming from Free, whichever paid plan they picked. const isFromFree = previousPlanId === 'free' const projectRef = getLinkProjectRef(projects) return (

    Successfully upgraded

    You're on {planName}

    {organizationName ?? 'Your organization'} {' '} has access to everything below, starting now.

    {planId === 'pro' && (
    )} {planId === 'team' && (
    )}
      {isFromFree && ( )} {isFromFree && isSpendCapEnabled && ( )} {planId === 'team' && ( )} {planId === 'team' && ( )}
    ) }