import React from 'react'; import { FormControl, MenuItem, OutlinedInput, Select, ListItemText, } from '@mui/material'; import { DEVTOOLS_Z_INDEX } from '../../constants'; import { ScFieldTitle } from '../../ui/common/FieldTitle'; const getNsName = (ns: string) => { if (!ns) { return ''; } return ns; }; type Props = { options: string[]; value: string; onChange: (value: string) => void; }; export const NsSelect: React.FC = ({ onChange, options, value }) => { const namespaces = options; const namespaceOne = namespaces.length === 1; const namespaceEmpty = namespaceOne && namespaces[0] === ''; return ( <> {!namespaceEmpty && ( <> Namespace {namespaceOne ? ( getNsName(namespaces[0]) ) : ( )} )} ); };