'use client' import { Organization } from '~/data/organizations' import { useSendTelemetryEvent } from '~/lib/telemetry' import Link from 'next/link' import { plans } from 'shared-data/plans' import { Button, cn } from 'ui' import { Check } from './PricingIcons' import UpgradePlan from './UpgradePlan' import { isCrossZoneHref } from '@/lib/cross-zone' interface PricingPlansProps { organizations?: Organization[] hasExistingOrganizations?: boolean } const PricingPlans = ({ organizations, hasExistingOrganizations }: PricingPlansProps) => { const sendTelemetryEvent = useSendTelemetryEvent() const orgSlug = organizations?.[0]?.slug return (
{plans.map((plan) => { const isProPlan = plan.name === 'Pro' const isFreePlan = plan.name === 'Free' const isTeamPlan = plan.name === 'Team' const isUpgradablePlan = isProPlan || isTeamPlan const features = plan.features const footer = plan.footer const sendPricingEvent = () => { sendTelemetryEvent({ action: 'www_pricing_plan_cta_clicked', properties: { plan: plan.name, showUpgradeText: isUpgradablePlan && hasExistingOrganizations ? true : false, section: 'main', }, ...(orgSlug && { groups: { organization: orgSlug } }), }) } return (

{plan.name}

{plan.nameBadge && ( {plan.nameBadge} )}

{plan.description}

{plan.priceLabel}

{plan.name !== 'Enterprise' ? '$' : ''} {plan.priceMonthly}

{plan.costUnit}

{isUpgradablePlan && hasExistingOrganizations ? ( ) : ( )} {footer || isUpgradablePlan ? (

{isUpgradablePlan ? ( First project included.
Additional from $10/mo. See how pricing scales
) : ( footer )}

) : null}

{plan.preface}

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

    {feature[1]}

    )}
  • ))}
) })}
) } export default PricingPlans