import type { ReactNode } from "react"; import { classNames } from "@calcom/lib"; import { useHasPaidPlan } from "@calcom/lib/hooks/useHasPaidPlan"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import isCalcom from "@calcom/lib/isCalcom"; import { EmptyScreen } from "@calcom/ui"; import { FiUsers } from "@calcom/ui/components/icon"; export function UpgradeTip({ dark, title, emptyTitle, emptyDescription, description, background, features, buttons, isParentLoading, children, }: { dark?: boolean; title: string; description: string; /* overwrite EmptyScreen text */ emptyTitle?: string; emptyDescription?: string; 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; }) { const { t } = useLocale(); const { isLoading, hasPaidPlan } = useHasPaidPlan(); if (hasPaidPlan) return children; if (isParentLoading || isLoading) return <>{isParentLoading}; if (!isCalcom) return ( ); return ( <>

{t(title)}

{t(description)}

{buttons}
{features.map((feature) => (
{feature.icon}

{feature.title}

{feature.description}

))}
); }