// @ts-nocheck import * as R from 'ramda'; import { PricingPlan } from '@/components/PricingPlan/PricingPlan'; import { SubscriptionPlansPeriod } from '@/store/plans/plans.reducer'; import { WithPlansProps, withPlans, } from '@/containers/Subscriptions/withPlans'; import { ButtonProps } from '@blueprintjs/core'; interface SubscriptionPricingFeature { text: string; hint?: string; hintLabel?: string; style?: Record; } interface SubscriptionPricingProps { slug: string; label: string; description: string; features?: Array; featured?: boolean; monthlyPrice: string; monthlyPriceLabel: string; annuallyPrice: string; annuallyPriceLabel: string; onSubscribe?: (variantId: number) => void; subscribeButtonProps?: Optional; } interface SubscriptionPricingCombinedProps extends SubscriptionPricingProps, WithPlansProps {} function SubscriptionPlanRoot({ label, description, featured, features, monthlyPrice, monthlyPriceLabel, annuallyPrice, annuallyPriceLabel, onSubscribe, subscribeButtonProps, // #withPlans plansPeriod, }: SubscriptionPricingCombinedProps) { const handleClick = () => { onSubscribe && onSubscribe(); }; return ( {featured && Most Popular} {plansPeriod === SubscriptionPlansPeriod.Monthly ? ( ) : ( )} Subscribe {features?.map((feature) => ( {feature.text} ))} ); } export const SubscriptionPlan = R.compose( withPlans(({ plansPeriod }) => ({ plansPeriod })), )(SubscriptionPlanRoot);