ts
This commit is contained in:
1 parent
bda3a7e91c
commit
b4e4ec1110
6 files changed
+12
-18
No files matched your search
@@ -2,7 +2,7 @@ import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Box from "@mui/material/Box";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { lighten, darken } from "@mui/material/styles";
|
||||
import { lighten } from "@mui/material/styles";
|
||||
import useMediaQuery from "@mui/material/useMediaQuery";
|
||||
import type { PaletteKey } from "@/theme/theme";
|
||||
import { BaseBox, TooltipWithInfo } from "@/components/design-elements";
|
||||
|
||||
@@ -5,7 +5,6 @@ import Menu from "@mui/material/Menu";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import type { ButtonGroupProps } from "@mui/material/ButtonGroup";
|
||||
import { ChevronDown } from "lucide-react";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
|
||||
export const ButtonGroupInput: React.FC<ButtonGroupProps> = ({
|
||||
orientation,
|
||||
@@ -14,7 +13,6 @@ export const ButtonGroupInput: React.FC<ButtonGroupProps> = ({
|
||||
...props
|
||||
}) => {
|
||||
const isVertical = orientation === "vertical";
|
||||
const theme = useTheme();
|
||||
|
||||
if (!isVertical) {
|
||||
return (
|
||||
|
||||
@@ -10,6 +10,7 @@ import { useMemo, useState } from "react";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { Tooltip } from "@/components/design-elements";
|
||||
import { config } from "@/config/index";
|
||||
const ENV_VAR = import.meta.env.VITE_APP_DEPLOYMENT_MODE;
|
||||
const DEPLOYMENT_MODE = config.DEPLOYMENT_MODE;
|
||||
const IS_SAAS = DEPLOYMENT_MODE === "saas";
|
||||
|
||||
@@ -32,12 +33,13 @@ export const SettingsSwitch = () => {
|
||||
handleClose();
|
||||
};
|
||||
|
||||
const user = useAppSelector((state) => state.auth.user);
|
||||
const user = useAppSelector((state: any) => state.auth.user);
|
||||
|
||||
const orgPermissions = user?.org?.permissions || [];
|
||||
// Normalize and memoize permissions for robust checks
|
||||
const perms = useMemo(
|
||||
() => orgPermissions.map((p) => (p ?? "").toString().trim().toLowerCase()),
|
||||
() =>
|
||||
orgPermissions.map((p: any) => (p ?? "").toString().trim().toLowerCase()),
|
||||
[orgPermissions]
|
||||
);
|
||||
const hasTeamEdit =
|
||||
@@ -64,6 +66,8 @@ export const SettingsSwitch = () => {
|
||||
[perms]
|
||||
);
|
||||
|
||||
console.log("ENV VAR: ", ENV_VAR);
|
||||
console.log("DEPLOYMENT_MODE: ", DEPLOYMENT_MODE);
|
||||
console.log("Show billing: ", showBilling);
|
||||
console.log(JSON.stringify(perms, null, 2));
|
||||
console.log("IS_SAAS: ", IS_SAAS);
|
||||
|
||||
Reference in new issue
Block a user