ESPTrainer built with Meteor and React

Actions.jsx 458B

12345678910111213141516
  1. import React, { PropTypes } from 'react';
  2. import './styles/Actions';
  3. const Actions = ({ actions }) => <div className="actions">
  4. { actions.map(action => <button key={action.label} disabled={!action.active()} onClick={action.action}>{action.label}</button>) }
  5. </div>;
  6. Actions.propTypes = {
  7. actions: PropTypes.arrayOf(PropTypes.shape({
  8. label: PropTypes.string,
  9. action: PropTypes.func,
  10. active: PropTypes.func
  11. })).isRequired
  12. };
  13. export default Actions;