diff --git a/frontend/src/_components/OrganizationManager/CustomSelect.jsx b/frontend/src/_components/OrganizationManager/CustomSelect.jsx index 2642b3a9f1..d9b29ac1d8 100644 --- a/frontend/src/_components/OrganizationManager/CustomSelect.jsx +++ b/frontend/src/_components/OrganizationManager/CustomSelect.jsx @@ -1,52 +1,45 @@ import React, { useState } from 'react'; import Select from '@/_ui/Select'; import { components } from 'react-select'; -import { EditOrganization } from './EditOrganization'; import { CreateOrganization } from './CreateOrganization'; import { useTranslation } from 'react-i18next'; import { authenticationService } from '@/_services'; import SolidIcon from '@/_ui/Icon/SolidIcons'; import { ToolTip } from '@/_components'; import { decodeEntities } from '@/_helpers/utils'; - const Menu = (props) => { const { t } = useTranslation(); const { admin } = authenticationService.currentSessionValue; const darkMode = localStorage.getItem('darkMode') === 'true'; + return ( -
- {admin && ( - <> -
props.selectProps.setShowEditOrg(true)} - > -
-
{props?.selectProps?.value?.label}
-
- -
-
+
+ <> +
+
+
Workspaces ({props.options.length})
+ {admin && ( + +
+ +
+
+ )}
- - )} -
{props.children}
-
-
-
+ -
- -
- {t('header.organization.addNewWorkSpace', 'Add new workspace')} -
+
{props.children}
); @@ -65,22 +58,18 @@ const SingleValue = ({ selectProps }) => { }; export const CustomSelect = ({ ...props }) => { - const [showEditOrg, setShowEditOrg] = useState(false); const [showCreateOrg, setShowCreateOrg] = useState(false); const darkMode = localStorage.getItem('darkMode') === 'true'; - const currentValue = props?.options.find((option) => option?.value === props?.value); return ( <> -