1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-04 15:14:29 +01:00
metamask-extension/ui/components/app/permissions-connect-permission-list/permissions-connect-permission-list.js

30 lines
859 B
JavaScript
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import { usePermissionDescriptions } from '../../../hooks/usePermissionDescriptions';
export default function PermissionsConnectPermissionList({ permissions }) {
const getPermissionDescription = usePermissionDescriptions();
return (
<div className="permissions-connect-permission-list">
{Object.keys(permissions).map((permission) => {
const { label, leftIcon, rightIcon } = getPermissionDescription(
permission,
);
return (
<div className="permission" key={permission}>
<i className={leftIcon} />
{label}
{rightIcon && <i className={rightIcon} />}
</div>
);
})}
</div>
);
}
PermissionsConnectPermissionList.propTypes = {
permissions: PropTypes.object.isRequired,
};