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