import React from 'react'; import PropTypes from 'prop-types'; import { getWeightedPermissions } from '../../../../helpers/utils/permission'; import { useI18nContext } from '../../../../hooks/useI18nContext'; import PermissionCell from '../../permission-cell'; import Box from '../../../ui/box'; export default function UpdateSnapPermissionList({ approvedPermissions, revokedPermissions, newPermissions, targetSubjectMetadata, }) { const t = useI18nContext(); return ( {getWeightedPermissions(t, newPermissions, targetSubjectMetadata).map( (permission, index) => ( ), )} {getWeightedPermissions(t, revokedPermissions, targetSubjectMetadata).map( (permission, index) => ( ), )} {getWeightedPermissions( t, approvedPermissions, targetSubjectMetadata, ).map((permission, index) => ( ))} ); } UpdateSnapPermissionList.propTypes = { /** * Permissions that have already been approved */ approvedPermissions: PropTypes.object.isRequired, /** * Previously used permissions that are now revoked */ revokedPermissions: PropTypes.object.isRequired, /** * New permissions that are being requested */ newPermissions: PropTypes.object.isRequired, targetSubjectMetadata: PropTypes.object.isRequired, };