strapi-plugin-config-sync/admin/src/components/ConfirmModal/index.js

34 lines
685 B
JavaScript
Raw Normal View History

2021-03-20 16:51:34 +01:00
import React from 'react';
import {
ModalConfirm,
} from 'strapi-helper-plugin';
import getTrad from '../../helpers/getTrad';
const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
2021-03-21 17:55:14 +01:00
if (!isOpen) return null;
2021-03-20 16:51:34 +01:00
return (
<ModalConfirm
confirmButtonLabel={{
id: getTrad(`popUpWarning.button.${type}`),
}}
isOpen={isOpen}
toggle={onClose}
onClosed={onClose}
onConfirm={() => {
onClose();
onSubmit();
}}
type="success"
content={{
id: getTrad(`popUpWarning.warning.${type}`),
values: {
br: () => <br />,
},
}}
2021-03-21 17:55:14 +01:00
/>
2021-03-20 16:51:34 +01:00
);
}
export default ConfirmModal;