import {Select} from 'antd'

const { Option } = Select

interface StandardComponentProps {
  dictionary: Map<any, any>,
}

export const SelectFromDictionary = ({dictionary, ...other}: StandardComponentProps) =>{
  const options: any[] = []
  dictionary.forEach((value, key) => {
    options.push(
      <Option 
        key={key}
        value={key}>
        {value}
      </Option>)
  })

  return <Select {...other}>
  {options}
</Select>
}
