'use client' import { PricingTableRowDesktop, PricingTableRowMobile } from '~/components/Pricing/PricingTableRow' import Solutions from '~/data/MainProducts' import { Organization } from '~/data/organizations' import { useSendTelemetryEvent } from '~/lib/telemetry' import { useIsomorphicLayoutEffect } from 'common' import Link from 'next/link' import { useRef, useState } from 'react' import { plans } from 'shared-data/plans' import { pricing } from 'shared-data/pricing' import { Button, cn, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, } from 'ui' import UpgradePlan from './UpgradePlan' import { isCrossZoneHref } from '@/lib/cross-zone' const MobileHeader = ({ description, priceDescription, price, plan, showDollarSign = true, from = false, organizations, hasExistingOrganizations, }: { description: string priceDescription: string price: string plan: string showDollarSign?: boolean from?: boolean organizations?: Organization[] hasExistingOrganizations?: boolean }) => { const sendTelemetryEvent = useSendTelemetryEvent() const orgSlug = organizations?.[0]?.slug const selectedPlan = plans.find((p) => p.name === plan)! const isUpgradablePlan = selectedPlan.name === 'Pro' || selectedPlan.name === 'Team' const trackPlanCtaClick = () => sendTelemetryEvent({ action: 'www_pricing_plan_cta_clicked', properties: { plan, showUpgradeText: false, section: 'comparison_table', tableMode: 'mobile', }, ...(orgSlug && { groups: { organization: orgSlug } }), }) return (
{priceDescription}
{description}
{isUpgradablePlan && hasExistingOrganizations ? (| Feature by | {plans.map((plan) => { const isUpgradablePlan = plan.name === 'Pro' || plan.name === 'Team' const trackPlanCtaClick = () => sendTelemetryEvent({ action: 'www_pricing_plan_cta_clicked', properties: { plan: plan.name, showUpgradeText: false, section: 'comparison_table', tableMode: 'desktop', }, ...(orgSlug && { groups: { organization: orgSlug } }), }) return (
{plan.name}{plan.name !== 'Enterprise' && '$'} {plan.priceMonthly} {['Free', 'Pro', 'Team'].includes(plan.name) && ( {plan.costUnit} )} {isUpgradablePlan && hasExistingOrganizations ? ( |
)
})}
|---|