'use strict'; import React from 'react'; let GlobalAction = React.createClass({ propTypes: { requestActions: React.PropTypes.object }, render() { let pieceActions = null; if (this.props.requestActions && this.props.requestActions.pieces){ pieceActions = this.props.requestActions.pieces.map((item) => { return (
{item}
); }); } let editionActions = null; if (this.props.requestActions && this.props.requestActions.editions){ editionActions = Object.keys(this.props.requestActions.editions).map((pieceId) => { return this.props.requestActions.editions[pieceId].map((item) => { return (
{item}
); }); }); } if (pieceActions || editionActions) { return (
{pieceActions} {editionActions}
); } return null; } }); export default GlobalAction;