import * as React from "react" ; import "../styles/Dropdown.css" ; export interface IDropdownProps { options : string [ ] ; name : string ; onSelect ? : ( event : React . ChangeEvent < HTMLSelectElement > ) => void ; } export const Dropdown = props => { return ( < select className = "dropdown" onChange = { props . onSelect } title = { props . name } name = { props . name } > { renderOptions ( props . options ) } < /select>); } ; const renderOptions = ( options ) => { return options . map ( ( name , index ) => { return ( < option key = { name } value = { name } > { name } < /option>); } ) ; } ;