import React, { Component } from 'react'; import { Grid, Cell, List, ListItem, ListItemContent } from 'react-mdl'; import { AppsLinkList, TogglesLinkList, HeaderTitle } from '../common'; class ShowStrategyComponent extends Component { componentDidMount () { if (!this.props.strategy) { this.props.fetchStrategies(); }; if (!this.props.applications || this.props.applications.length === 0) { this.props.fetchApplications(); } if (!this.props.toggles || this.props.toggles.length === 0) { this.props.fetchFeatureToggles(); } } renderParameters (params) { if (params) { return params.map(({ name, type, description, required }, i) => ( {name} ({type}) )); } else { return (no params); } } render () { const { strategy, strategyName, applications, toggles, } = this.props; if (!strategy) { return
Cannot find Strategy "{strategyName}".
; } const { name, description, parameters = [], } = strategy; return (
Parameters

{this.renderParameters(parameters)}
Applications using this strategy

Toggles using this strategy

); } } export default ShowStrategyComponent;