import React from 'react' ; import { i18n } from '@kbn/i18n' ; import { Props , StylePropEditor } from '../style_prop_editor' ; import { DynamicColorForm } from './dynamic_color_form' ; import { StaticColorForm } from './static_color_form' ; import { ColorDynamicOptions , ColorStaticOptions } from '../../../../../../common/descriptor_types' ; type ColorEditorProps = Omit < Props < ColorStaticOptions , ColorDynamicOptions > , 'children' > & { swatches : string [ ] ; } ; export function VectorStyleColorEditor ( props ) { const colorForm = props . styleProperty . isDynamic ( ) ? ( < DynamicColorForm { ... props } / > ) : ( < StaticColorForm { ... props } / > ) ; return ( < StylePropEditor < ColorStaticOptions , ColorDynamicOptions > { ... props } customStaticOptionLabel = { i18n . translate ( 'xpack.maps.styles.color.staticDynamicSelect.staticLabel' , { defaultMessage : 'Solid' , } ) } > { colorForm } < /StylePropEditor>); }