Sha256: 455a672b551350bff5e30ba1f475ff3e3f5b173293bfe6037dfda5ffd5c637e8
Contents?: true
Size: 939 Bytes
Versions: 7
Compression:
Stored size: 939 Bytes
Contents
import React from 'react'; import PropTypes from 'prop-types'; import { CancelButton } from './CancelButton'; import { ResumeButton } from './ResumeButton'; export const ActionButton = ({ id, name, availableActions, taskActions }) => { const isResume = availableActions.resumable; if (isResume) { return ( <ResumeButton id={id} name={name} onClick={taskActions.resume} disabled={false} /> ); } return ( <CancelButton id={id} name={name} disabled={!availableActions.cancellable} onClick={taskActions.cancel} /> ); }; ActionButton.propTypes = { id: PropTypes.string.isRequired, name: PropTypes.string.isRequired, availableActions: PropTypes.shape({ cancellable: PropTypes.bool, resumable: PropTypes.bool, }).isRequired, taskActions: PropTypes.shape({ cancel: PropTypes.func, resume: PropTypes.func, }).isRequired, };
Version data entries
7 entries across 7 versions & 1 rubygems