webpack/components/common/DeleteTableEntry.js in foreman_acd-0.9.7 vs webpack/components/common/DeleteTableEntry.js in foreman_acd-0.10.0
- old
+ new
@@ -1,27 +1,23 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';
-import {
- Icon,
- Button,
- MessageDialog,
-} from 'patternfly-react';
+import { Icon, Button, MessageDialog } from 'patternfly-react';
import { translate as __ } from 'foremanReact/common/I18n';
const DeleteTableEntry = ({
hidden,
disabled,
onDeleteTableEntry,
additionalData,
-}) =>{
+}) => {
+ const [showModal, setShowModal] = useState(false);
+ const toggleModal = () => setShowModal(!showModal);
+
if (hidden) {
return null;
}
- const [showModal, setShowModal] = useState(false);
- const toggleModal = () => setShowModal(!showModal);
-
return (
<span>
<MessageDialog
show={showModal}
onHide={toggleModal}
@@ -30,15 +26,11 @@
primaryActionButtonContent={__('Confirm')}
secondaryActionButtonContent={__('Cancel')}
title={__('Confirm action')}
primaryContent={__('Are you sure you wish to delete this item?')}
/>
- <Button
- bsStyle="default"
- disabled={disabled}
- onClick={toggleModal}
- >
- <Icon type="pf" name="delete" title={__("Delete entry")} />
+ <Button bsStyle="default" disabled={disabled} onClick={toggleModal}>
+ <Icon type="pf" name="delete" title={__('Delete entry')} />
</Button>
</span>
);
};