import * as _ from 'lodash'; import DropDownMenu from 'material-ui/DropDownMenu'; import MenuItem from 'material-ui/MenuItem'; import * as React from 'react'; export interface VersionDropDownProps { selectedVersion: string; versions: string[]; onVersionSelected: (semver: string) => void; } export interface VersionDropDownState {} export class VersionDropDown extends React.Component { public render(): React.ReactNode { return (
{this._renderDropDownItems()}
); } private _renderDropDownItems(): React.ReactNode[] { const items = _.map(this.props.versions, version => { return ; }); return items; } private _updateSelectedVersion(e: any, index: number, semver: string): void { this.props.onVersionSelected(semver); } }