import React, { Component } from 'react'; import Select from 'react-select'; import DescriptionOption from './DescriptionOption'; import IndicatorsContainer from './IndicatorsContainer'; import ResetStyles from './ResetStyles'; import NoOptionsMessage from './NoOptionsMessage'; export interface OptionWithDescription { value: any; label: string; description: string; } export interface Props { optionsWithDesc: OptionWithDescription[]; onSelected: (permission) => void; disabled: boolean; className?: string; value?: any; } const getSelectedOption = (optionsWithDesc, value) => optionsWithDesc.find(option => option.value === value); class DescriptionPicker extends Component { render() { const { optionsWithDesc, onSelected, disabled, className, value } = this.props; const selectedOption = getSelectedOption(optionsWithDesc, value); return (