From 2fe63fde05b4a3a2a6ac3a50ef28bfbc073b00ae Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 8 May 2022 13:22:20 -0700 Subject: Move components folder --- modern/src/common/attributes/AddAttributeDialog.js | 89 ---------------------- 1 file changed, 89 deletions(-) delete mode 100644 modern/src/common/attributes/AddAttributeDialog.js (limited to 'modern/src/common/attributes/AddAttributeDialog.js') diff --git a/modern/src/common/attributes/AddAttributeDialog.js b/modern/src/common/attributes/AddAttributeDialog.js deleted file mode 100644 index 37b36c76..00000000 --- a/modern/src/common/attributes/AddAttributeDialog.js +++ /dev/null @@ -1,89 +0,0 @@ -import React, { useState } from 'react'; -import { - Button, Dialog, DialogActions, DialogContent, FormControl, InputLabel, MenuItem, Select, TextField, -} from '@material-ui/core'; - -import { Autocomplete, createFilterOptions } from '@material-ui/lab'; -import { useTranslation } from '../components/LocalizationProvider'; - -const AddAttributeDialog = ({ open, onResult, definitions }) => { - const t = useTranslation(); - - const filter = createFilterOptions({ - stringify: (option) => option.name, - }); - - const options = Object.entries(definitions).map(([key, value]) => ({ - key, - name: value.name, - type: value.type, - })); - - const [key, setKey] = useState(); - const [type, setType] = useState('string'); - - return ( - - - { - setKey(option && typeof option === 'object' ? option.key : option); - if (option && option.type) { - setType(option.type); - } - }} - filterOptions={(options, params) => { - const filtered = filter(options, params); - if (params.inputValue) { - filtered.push({ - key: params.inputValue, - name: params.inputValue, - }); - } - return filtered; - }} - options={options} - getOptionLabel={(option) => (option && typeof option === 'object' ? option.name : option)} - renderOption={(option) => option.name} - freeSolo - renderInput={(params) => ( - - )} - /> - - {t('sharedType')} - - - - - - - - - ); -}; - -export default AddAttributeDialog; -- cgit v1.2.3