import dayjs from "dayjs"; import Button from "@calcom/ui/Button"; import { TRIAL_LIMIT_DAYS } from "@lib/config/constants"; import { useLocale } from "@lib/hooks/useLocale"; import useMeQuery from "@lib/hooks/useMeQuery"; const TrialBanner = () => { const { t } = useLocale(); const query = useMeQuery(); const user = query.data; if (!user || user.plan !== "TRIAL") return null; const trialDaysLeft = user.trialEndsAt ? dayjs(user.trialEndsAt).add(1, "day").diff(dayjs(), "day") : dayjs(user.createdDate) .add(TRIAL_LIMIT_DAYS + 1, "day") .diff(dayjs(), "day"); return (
{t("trial_days_left", { days: trialDaysLeft })}
); }; export default TrialBanner;