mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* add badge for trial mode * fix tooltip issue * fix typo * add inactive team plan badge * change to one salesforce request * clean up * fix type error --------- Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: Bailey Pumfleet <[email protected]>
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import Link from "next/link";
|
|
|
|
import { useHasPaidPlan, useHasActiveTeamPlan } from "@calcom/lib/hooks/useHasPaidPlan";
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
|
|
import { Tooltip } from "../tooltip";
|
|
import { Badge } from "./Badge";
|
|
|
|
export const UpgradeTeamsBadge = function UpgradeTeamsBadge({
|
|
checkForActiveStatus,
|
|
}: {
|
|
checkForActiveStatus?: boolean;
|
|
}) {
|
|
const { t } = useLocale();
|
|
const { hasPaidPlan } = useHasPaidPlan();
|
|
const { hasActiveTeamPlan, isTrial } = useHasActiveTeamPlan();
|
|
|
|
if (hasPaidPlan) {
|
|
if (!checkForActiveStatus || hasActiveTeamPlan) return null;
|
|
}
|
|
|
|
const badgeString = isTrial ? t("trial_mode") : hasPaidPlan ? t("inactive_team_plan") : t("upgrade");
|
|
|
|
const tooltipString = isTrial
|
|
? t("limited_access_trial_mode")
|
|
: hasPaidPlan
|
|
? t("inactive_team_plan_description")
|
|
: t("upgrade_to_enable_feature");
|
|
|
|
return (
|
|
<Tooltip content={tooltipString}>
|
|
<Link href={!hasPaidPlan ? "/teams" : ""}>
|
|
<Badge variant="gray">{badgeString}</Badge>
|
|
</Link>
|
|
</Tooltip>
|
|
);
|
|
};
|