Sha256: 13ff9ca2320c58d870bd328acaf7641144ee5dc232614cc863117389d5f2f48a

Contents?: true

Size: 884 Bytes

Versions: 2

Compression:

Stored size: 884 Bytes

Contents

import React from 'react';
import PropTypes from 'prop-types';
import {
  Icon,
  Button,
} from 'patternfly-react';
import { translate as __ } from 'foremanReact/common/I18n';

const DeleteTableEntry = ({
  hidden,
  disabled,
  onDeleteTableEntry,
  additionalData,
}) =>{
  if (hidden) {
    return null;
  }

  return (
    <span>
      <Button
        bsStyle="default"
        disabled={disabled}
        onClick={() => window.confirm(__("Are you sure you wish to delete this item?")) && onDeleteTableEntry(additionalData) }
      >
        <Icon type="pf" name="delete" title={__("Delete entry")} />
      </Button>
    </span>
  );
};

DeleteTableEntry.propTypes = {
  hidden: PropTypes.bool.isRequired,
  disabled: PropTypes.bool.isRequired,
  onDeleteTableEntry: PropTypes.func.isRequired,
  additionalData: PropTypes.object.isRequired,
};

export default DeleteTableEntry;

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_acd-0.7.0 webpack/components/common/DeleteTableEntry.js
foreman_acd-0.6.0 webpack/components/common/DeleteTableEntry.js