1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 15:50:28 +01:00
metamask-extension/ui/components/institutional/compliance-details-modal/compliance-details-modal.js
Albert Olivé 319696b4ef
[MMI] Added compliance details modal and compliance details component (#18118)
* Added compliance details modal and compliance details component

* Finished component

* Fixed test name
2023-05-05 14:07:51 +02:00

37 lines
1021 B
JavaScript

import PropTypes from 'prop-types';
import React, { useContext } from 'react';
import { useDispatch } from 'react-redux';
import Modal from '../../app/modal';
import { hideModal } from '../../../store/actions';
import ComplianceDetails from '../compliance-details';
import { I18nContext } from '../../../contexts/i18n';
export default function ComplianceDetailsModal({
onGenerateComplianceReport,
reportAddress,
}) {
const dispatch = useDispatch();
const handleClose = () => dispatch(hideModal);
const t = useContext(I18nContext);
return (
<Modal
headerText={t('amlCompliance')}
hideFooter="true"
onClose={handleClose}
contentClass="compliance-details-modal-content"
>
<ComplianceDetails
address={reportAddress}
onClose={handleClose}
onGenerate={onGenerateComplianceReport}
/>
</Modal>
);
}
ComplianceDetailsModal.propTypes = {
reportAddress: PropTypes.func.isRequired,
onGenerateComplianceReport: PropTypes.func.isRequired,
};