import type { ReactNode } from "react"; import { classNames } from "@calcom/lib"; import { useHasTeamPlan } from "@calcom/lib/hooks/useHasPaidPlan"; import { useLocale } from "@calcom/lib/hooks/useLocale"; export function UpgradeTip({ dark, title, description, background, features, buttons, isParentLoading, children, plan, }: { dark?: boolean; title: string; description: string; /* overwrite EmptyScreen text */ background: string; features: Array<{ icon: JSX.Element; title: string; description: string }>; buttons?: JSX.Element; /**Chldren renders when the user is in a team */ children: JSX.Element; isParentLoading?: ReactNode; plan: "team" | "enterprise"; }) { const { t } = useLocale(); const { isLoading, hasTeamPlan } = useHasTeamPlan(); const hasEnterprisePlan = false; //const { isLoading , hasEnterprisePlan } = useHasEnterprisePlan(); if (plan === "team" && hasTeamPlan) return children; if (plan === "enterprise" && hasEnterprisePlan) return children; if (isLoading) return <>{isParentLoading}>; return ( <>
{t(description)}
{buttons}{feature.description}