mirror of
https://github.com/docmost/docmost.git
synced 2026-05-18 07:24:04 +08:00
d7a5fda53c
* feat: feature flag upgrade * fix translations * refactor * fix * fix
17 lines
528 B
TypeScript
17 lines
528 B
TypeScript
import { useAtom } from "jotai";
|
|
import { useTranslation } from "react-i18next";
|
|
import { entitlementAtom } from "@/ee/entitlement/entitlement-atom";
|
|
import { isCloud } from "@/lib/config";
|
|
|
|
export function useUpgradeLabel(): string {
|
|
const { t } = useTranslation();
|
|
const [entitlements] = useAtom(entitlementAtom);
|
|
|
|
if (!isCloud()) {
|
|
return entitlements != null && entitlements.tier !== "free"
|
|
? t("Upgrade your license tier.")
|
|
: t("Available with a paid license");
|
|
}
|
|
return t("Upgrade your plan");
|
|
}
|