import { useParams } from 'common' import { plans as subscriptionsPlans } from 'shared-data/plans' import { AwsMarketplacePurchaseCallout } from './AwsMarketplacePurchaseCallout' import { EnterpriseCard } from './EnterpriseCard' import { PlanCard } from './PlanCard' import { getLiftedSide } from './PlanCards.utils' import { getPlanChangeType } from '@/components/interfaces/Billing/Subscription/Subscription.utils' import type { OrgPlan, PlanId } from '@/data/subscriptions/types' import { useTrack } from '@/lib/telemetry/track' import type { Organization } from '@/types/base' export interface PlanCardsProps { availablePlans: OrgPlan[] isLoadingPlans: boolean currentSubscriptionPlanId: PlanId | undefined currentSubscriptionPlanName: string | undefined canUpdateSubscription: boolean isPartnerBilledOrganization: boolean hasOrioleProjects: boolean selectedOrganization: Organization | undefined showAwsMarketplacePurchase?: boolean onSelectTier: (tier: 'tier_free' | 'tier_pro' | 'tier_team') => void } export function PlanCards({ availablePlans, isLoadingPlans, currentSubscriptionPlanId, currentSubscriptionPlanName, canUpdateSubscription, isPartnerBilledOrganization, hasOrioleProjects, selectedOrganization, showAwsMarketplacePurchase = false, onSelectTier, }: PlanCardsProps) { const { source } = useParams() const track = useTrack() const currentPlanIndex = subscriptionsPlans.findIndex( (plan) => plan.planId === currentSubscriptionPlanId ) return (