import React from 'react'; import PropTypes from 'prop-types'; import { Icon, Button, } from 'patternfly-react'; import { translate as __ } from 'foremanReact/common/I18n'; const LockTableEntry = ({ hidden, disabled, onLockTableEntry, additionalData, }) =>{ if (hidden) { return null; } let lockButton; let lockButtonTitle; if (additionalData.rowData.locked === true) { lockButton = 'locked'; if (disabled === true) { lockButtonTitle = 'this entry is locked'; } else { lockButtonTitle = 'unlock this entry'; } } else { lockButton = 'unlocked'; if (disabled === true) { lockButtonTitle = 'this entry is unlocked'; } else { lockButtonTitle = 'lock this entry'; } } return ( ); }; LockTableEntry.propTypes = { hidden: PropTypes.bool, disabled: PropTypes.bool.isRequired, onLockTableEntry: PropTypes.func.isRequired, additionalData: PropTypes.object.isRequired, }; export default LockTableEntry;