feat: battle of ts - unlimited edition

This commit is contained in:
=
2025-10-10 00:09:46 +05:30
parent fd98465dec
commit 44c9575a3d
38 changed files with 492 additions and 498 deletions
@@ -7,6 +7,7 @@ import { createNotification } from "@app/components/notifications";
import { Button, Checkbox, Modal, ModalContent, Tooltip } from "@app/components/v2";
import { useOrgPermission } from "@app/context";
import { useUpgradePrivilegeSystem } from "@app/hooks/api";
import { OrgMembershipRole } from "@app/helpers/roles";
const formSchema = z.object({
isProjectPrivilegesUpdated: z.literal(true),
@@ -21,7 +22,7 @@ type Props = {
};
export const UpgradePrivilegeSystemModal = ({ isOpen, onOpenChange }: Props) => {
const { membership } = useOrgPermission();
const { hasOrgRole } = useOrgPermission();
const [step, setStep] = useState<"info" | "upgrade">("info");
const {
@@ -65,7 +66,7 @@ export const UpgradePrivilegeSystemModal = ({ isOpen, onOpenChange }: Props) =>
setStep("info");
};
const isAdmin = membership?.role === "admin";
const isAdmin = hasOrgRole(OrgMembershipRole.Admin);
return (
<Modal isOpen={isOpen} onOpenChange={handleClose}>
@@ -274,7 +275,7 @@ export const UpgradePrivilegeSystemModal = ({ isOpen, onOpenChange }: Props) =>
<Tooltip
content={
!isAdmin
? `You cannot perform this upgrade because you are not an organization admin. (Your current role: ${membership?.role ?? "Unknown"})`
? `You cannot perform this upgrade because you are not an organization admin.`
: undefined
}
>