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

32 lines
894 B
JavaScript
Raw Normal View History

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