2021-02-22 17:20:42 +01:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2022-12-01 16:46:06 +01:00
|
|
|
import classnames from 'classnames';
|
2021-02-22 17:20:42 +01:00
|
|
|
import Button from '../../../../components/ui/button';
|
|
|
|
|
|
|
|
export default function ConfirmationFooter({
|
2022-12-01 16:46:06 +01:00
|
|
|
onSubmit,
|
2021-02-22 17:20:42 +01:00
|
|
|
onCancel,
|
2022-12-01 16:46:06 +01:00
|
|
|
submitText,
|
2021-02-22 17:20:42 +01:00
|
|
|
cancelText,
|
|
|
|
alerts,
|
|
|
|
}) {
|
|
|
|
return (
|
|
|
|
<div className="confirmation-footer">
|
|
|
|
{alerts}
|
|
|
|
<div className="confirmation-footer__actions">
|
2022-12-01 16:46:06 +01:00
|
|
|
{onCancel ? (
|
|
|
|
<Button type="secondary" onClick={onCancel}>
|
|
|
|
{cancelText}
|
|
|
|
</Button>
|
|
|
|
) : null}
|
|
|
|
<Button
|
|
|
|
type="primary"
|
|
|
|
onClick={onSubmit}
|
|
|
|
className={classnames({
|
|
|
|
centered: !onCancel,
|
|
|
|
})}
|
|
|
|
>
|
|
|
|
{submitText}
|
2021-02-22 17:20:42 +01:00
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
ConfirmationFooter.propTypes = {
|
|
|
|
alerts: PropTypes.node,
|
2022-12-01 16:46:06 +01:00
|
|
|
onCancel: PropTypes.func,
|
|
|
|
cancelText: PropTypes.string,
|
|
|
|
onSubmit: PropTypes.func.isRequired,
|
|
|
|
submitText: PropTypes.string.isRequired,
|
2021-02-22 17:20:42 +01:00
|
|
|
};
|