import { isArray } from 'lodash' import type { ReactNode } from 'react' import type { PricingInformation } from 'shared-data' import { cn } from 'ui' import { PlanCheckIcon } from './PlanIcons' export interface PlanColumnProps { plan: PricingInformation price: ReactNode cta: ReactNode isCurrentPlan: boolean liftedSide?: 'left' | 'right' className?: string } /** * Subheadlines for the plans someone can upgrade to, written for a customer deciding * whether to pay rather than for the marketing pricing page. Plans without an entry fall * back to the shared `plan.description`, which `shared-data` also gives the pricing page. */ const PLAN_BENEFIT_HEADLINES: Partial> = { tier_pro: 'More compute, daily backups, no pausing, and email support whenever you need it.', tier_team: 'Compliance, access controls, and priority support for teams shipping to production.', } export const PlanColumn = ({ plan, price, cta, isCurrentPlan, liftedSide, className, }: PlanColumnProps) => { const hasPopularBadge = !isCurrentPlan && !!plan.nameBadge return (

{plan.name}

{isCurrentPlan ? ( Current plan ) : null} {hasPopularBadge ? ( {plan.nameBadge} ) : null}

{PLAN_BENEFIT_HEADLINES[plan.id] ?? plan.description}

{plan.priceLabel}

{price}

{plan.costUnit}

{cta} {plan.footer ? (

{plan.footer}

) : null}

{plan.preface}

    {plan.features.map((feature) => (
  • {typeof feature === 'string' ? feature : feature[0]}
    {typeof feature !== 'string' && isArray(feature) ? (

    {feature[1]}

    ) : null}
  • ))}
) }