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