import type { ReactNode } from "react";
import { classNames } from "@calcom/lib";
import { IS_SELF_HOSTED } from "@calcom/lib/constants";
import { useHasTeamPlan } from "@calcom/lib/hooks/useHasPaidPlan";
import { useLocale } from "@calcom/lib/hooks/useLocale";
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, hasTeamPlan } = useHasTeamPlan();
if (hasTeamPlan) return children;
if (isParentLoading || isLoading) return <>{isParentLoading}>;
if (IS_SELF_HOSTED)
return (
{t(description)}
{buttons}{feature.description}