import Select, { components } from 'react-select';
import data from '../../../utils/data';
import SettingsBlock from './SettingsBlock';
import { Title, Action, Description } from './SettingsBlockElements';
const DEFAULT_ELEMENT_ORDER = [ 'title', 'action', 'description' ];
const DropdownIndicator = ( props ) => (
{ data().getImage( 'icon-arrow-down.svg' ) }
);
const ELEMENT_RENDERERS = {
title: ( { title } ) =>
{ title },
action: ( { actionProps } ) => (
),
description: ( { description } ) => (
{ description }
),
};
const SelectSettingsBlock = ( {
title,
description,
order = DEFAULT_ELEMENT_ORDER,
...props
} ) => (
{ order.map( ( elementKey ) => {
const RenderElement = ELEMENT_RENDERERS[ elementKey ];
return RenderElement ? (
) : null;
} ) }
);
export default SelectSettingsBlock;