"use client"; import type { FC } from "react"; import { observer } from "mobx-react"; // plane imports import { BUSINESS_PLAN_FEATURES, ENTERPRISE_PLAN_FEATURES, PLANE_COMMUNITY_PRODUCTS, PRO_PLAN_FEATURES, SUBSCRIPTION_REDIRECTION_URLS, SUBSCRIPTION_WEBPAGE_URLS, TALK_TO_SALES_URL, } from "@plane/constants"; import { EProductSubscriptionEnum } from "@plane/types"; import { EModalWidth, ModalCore } from "@plane/ui"; import { cn } from "@plane/utils"; // components import { FreePlanCard, PlanUpgradeCard } from "@/components/license"; import type { TCheckoutParams } from "@/components/license/modal/card/checkout-button"; // Constants const COMMON_CARD_CLASSNAME = "flex flex-col w-full h-full justify-end col-span-12 sm:col-span-6 xl:col-span-3"; const COMMON_EXTRA_FEATURES_CLASSNAME = "pt-2 text-center text-xs text-custom-primary-200 font-medium hover:underline"; export type PaidPlanUpgradeModalProps = { isOpen: boolean; handleClose: () => void; }; export const PaidPlanUpgradeModal: FC = observer((props) => { const { isOpen, handleClose } = props; // derived values const isSelfHosted = true; const isTrialAllowed = false; const handleRedirection = ({ planVariant, priceId }: TCheckoutParams) => { // Get the product and price using plane community constants const product = PLANE_COMMUNITY_PRODUCTS[planVariant]; const price = product.prices.find((price) => price.id === priceId); const frequency = price?.recurring ?? "year"; // Redirect to the appropriate URL const redirectUrl = SUBSCRIPTION_REDIRECTION_URLS[planVariant][frequency] ?? TALK_TO_SALES_URL; window.open(redirectUrl, "_blank"); }; return (
{/* Free Plan Section */}
Upgrade to a paid plan and unlock missing features.

Dashboards, Workflows, Approvals, Time Management, and other superpowers are just a click away. Upgrade today to unlock features your teams need yesterday.

{/* Free plan details */}
{/* Pro plan */}
See full features list

} handleCheckout={handleRedirection} isSelfHosted={!!isSelfHosted} isTrialAllowed={!!isTrialAllowed} />
See full features list

} handleCheckout={handleRedirection} isSelfHosted={!!isSelfHosted} isTrialAllowed={!!isTrialAllowed} />
See full features list

} handleCheckout={handleRedirection} isSelfHosted={!!isSelfHosted} isTrialAllowed={!!isTrialAllowed} />
); });