import React from 'react' ; import { EuiSelect } from '@elastic/eui' ; import { SchemaType } from '../types' ; interface Props { fieldName : string ; fieldType : string ; updateExistingFieldType ( fieldName , fieldType ) : void ; disabled ? : boolean ; } export const SchemaFieldTypeSelect = ( { fieldName , fieldType , updateExistingFieldType , disabled , ... rest } ) => { const fieldTypeOptions = Object . values ( SchemaType ) . map ( ( type ) => ( { value : type , text : type } ) ) ; return ( < EuiSelect { ... rest } name = { fieldName } required value = { fieldType } options = { fieldTypeOptions } disabled = { disabled } onChange = { ( e ) => updateExistingFieldType ( fieldName , e . target . value ) } data - test - subj = "SchemaSelect" / > ) ; } ;