2019-08-31 04:07:25 +05:00
|
|
|
import React from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
2023-01-24 18:53:13 +01:00
|
|
|
import { useTranslation } from 'react-i18next';
|
2019-08-31 04:07:25 +05:00
|
|
|
import { Button } from 'semantic-ui-react';
|
|
|
|
|
import { Popup } from '../../lib/custom-ui';
|
|
|
|
|
|
2020-05-29 19:31:19 +05:00
|
|
|
import styles from './DeleteStep.module.scss';
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2023-01-24 18:53:13 +01:00
|
|
|
const DeleteStep = React.memo(({ title, content, buttonContent, onConfirm, onBack }) => {
|
|
|
|
|
const [t] = useTranslation();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Popup.Header onBack={onBack}>
|
|
|
|
|
{t(title, {
|
|
|
|
|
context: 'title',
|
|
|
|
|
})}
|
|
|
|
|
</Popup.Header>
|
|
|
|
|
<Popup.Content>
|
|
|
|
|
<div className={styles.content}>{t(content)}</div>
|
|
|
|
|
<Button fluid negative content={t(buttonContent)} onClick={onConfirm} />
|
|
|
|
|
</Popup.Content>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
});
|
2019-08-31 04:07:25 +05:00
|
|
|
|
|
|
|
|
DeleteStep.propTypes = {
|
|
|
|
|
title: PropTypes.string.isRequired,
|
|
|
|
|
content: PropTypes.string.isRequired,
|
|
|
|
|
buttonContent: PropTypes.string.isRequired,
|
|
|
|
|
onConfirm: PropTypes.func.isRequired,
|
|
|
|
|
onBack: PropTypes.func,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
DeleteStep.defaultProps = {
|
|
|
|
|
onBack: undefined,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default DeleteStep;
|