import Link from 'next/link' import { useRouter } from 'next/router' import { useState } from 'react' import { useTelemetryProps } from 'common/hooks/useTelemetryProps' import { plans } from 'shared-data/plans' import { pricing } from 'shared-data/pricing' import { Button, Select, cn } from 'ui' import { PricingTableRowDesktop, PricingTableRowMobile } from '~/components/Pricing/PricingTableRow' import { Organization } from '~/data/organizations' import Solutions from '~/data/Solutions' import gaEvents from '~/lib/gaEvents' import Telemetry, { TelemetryEvent } from '~/lib/telemetry' import UpgradePlan from './UpgradePlan' 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 router = useRouter() const telemetryProps = useTelemetryProps() const sendTelemetryEvent = async (event: TelemetryEvent) => { await Telemetry.sendEvent(event, telemetryProps, router) } const selectedPlan = plans.find((p) => p.name === plan)! const isUpgradablePlan = selectedPlan.name === 'Pro' || selectedPlan.name === 'Team' return (
{priceDescription}
{description}
{isUpgradablePlan && hasExistingOrganizations ? (| Feature by | {plans.map((plan) => { const isUpgradablePlan = plan.name === 'Pro' || plan.name === 'Team' return (
{plan.name}{plan.name !== 'Enterprise' && '$'} {plan.priceMonthly} {['Free', 'Pro', 'Team'].includes(plan.name) && ( {plan.costUnit} )} {isUpgradablePlan && hasExistingOrganizations ? ( |
)
})}
|---|