2024-07-18 15:45:37 +05:30
|
|
|
import { useState } from "react";
|
2024-06-17 18:03:32 +05:30
|
|
|
import { observer } from "mobx-react";
|
2025-06-16 17:18:41 +05:30
|
|
|
// ui
|
2025-05-28 00:58:22 +05:30
|
|
|
import { useTranslation } from "@plane/i18n";
|
2024-07-18 15:45:37 +05:30
|
|
|
import { Button, Tooltip } from "@plane/ui";
|
2024-06-17 18:03:32 +05:30
|
|
|
// hooks
|
|
|
|
|
import { usePlatformOS } from "@/hooks/use-platform-os";
|
2025-08-19 07:36:42 -07:00
|
|
|
import packageJson from "package.json";
|
2024-07-18 15:45:37 +05:30
|
|
|
// local components
|
2025-04-11 20:37:25 +05:30
|
|
|
import { PaidPlanUpgradeModal } from "../license";
|
2024-06-17 18:03:32 +05:30
|
|
|
|
|
|
|
|
export const WorkspaceEditionBadge = observer(() => {
|
2024-07-18 15:45:37 +05:30
|
|
|
// states
|
|
|
|
|
const [isPaidPlanPurchaseModalOpen, setIsPaidPlanPurchaseModalOpen] = useState(false);
|
2025-05-28 00:58:22 +05:30
|
|
|
// translation
|
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
// platform
|
|
|
|
|
const { isMobile } = usePlatformOS();
|
2024-06-17 18:03:32 +05:30
|
|
|
|
|
|
|
|
return (
|
2024-07-18 15:45:37 +05:30
|
|
|
<>
|
|
|
|
|
<PaidPlanUpgradeModal
|
|
|
|
|
isOpen={isPaidPlanPurchaseModalOpen}
|
|
|
|
|
handleClose={() => setIsPaidPlanPurchaseModalOpen(false)}
|
|
|
|
|
/>
|
|
|
|
|
<Tooltip tooltipContent={`Version: v${packageJson.version}`} isMobile={isMobile}>
|
|
|
|
|
<Button
|
|
|
|
|
tabIndex={-1}
|
|
|
|
|
variant="accent-primary"
|
2024-09-02 21:29:09 +05:30
|
|
|
className="w-fit min-w-24 cursor-pointer rounded-2xl px-2 py-1 text-center text-sm font-medium outline-none"
|
2024-07-18 15:45:37 +05:30
|
|
|
onClick={() => setIsPaidPlanPurchaseModalOpen(true)}
|
2025-05-28 00:58:22 +05:30
|
|
|
aria-haspopup="dialog"
|
|
|
|
|
aria-label={t("aria_labels.projects_sidebar.edition_badge")}
|
2024-07-18 15:45:37 +05:30
|
|
|
>
|
2025-04-11 20:37:25 +05:30
|
|
|
Community
|
2024-07-18 15:45:37 +05:30
|
|
|
</Button>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</>
|
2024-06-17 18:03:32 +05:30
|
|
|
);
|
|
|
|
|
});
|