| 12345678910111213141516 |
- import React, { PropTypes } from 'react';
- import './styles/Actions';
-
- const Actions = ({ actions }) => <div className="actions">
- { actions.map(action => <button key={action.label} disabled={!action.active()} onClick={action.action}>{action.label}</button>) }
- </div>;
-
- Actions.propTypes = {
- actions: PropTypes.arrayOf(PropTypes.shape({
- label: PropTypes.string,
- action: PropTypes.func,
- active: PropTypes.func
- })).isRequired
- };
-
- export default Actions;
|