2022-03-04 17:56:31 +01:00
|
|
|
import React from 'react';
|
2021-12-02 18:22:18 +01:00
|
|
|
import PropTypes from 'prop-types';
|
2022-03-04 17:56:31 +01:00
|
|
|
import { usePermissionDescriptions } from '../../../hooks/usePermissionDescriptions';
|
2021-12-02 18:22:18 +01:00
|
|
|
|
|
|
|
export default function PermissionsConnectPermissionList({ permissions }) {
|
2022-03-04 17:56:31 +01:00
|
|
|
const getPermissionDescription = usePermissionDescriptions();
|
2021-12-02 18:22:18 +01:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="permissions-connect-permission-list">
|
2022-02-15 01:02:51 +01:00
|
|
|
{Object.keys(permissions).map((permission) => {
|
2022-03-04 17:56:31 +01:00
|
|
|
const { label, leftIcon, rightIcon } = getPermissionDescription(
|
|
|
|
permission,
|
|
|
|
);
|
2022-02-15 01:02:51 +01:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="permission" key={permission}>
|
|
|
|
<i className={leftIcon} />
|
|
|
|
{label}
|
|
|
|
{rightIcon && <i className={rightIcon} />}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
})}
|
2021-12-02 18:22:18 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
PermissionsConnectPermissionList.propTypes = {
|
2022-02-15 01:02:51 +01:00
|
|
|
permissions: PropTypes.object.isRequired,
|
2021-12-02 18:22:18 +01:00
|
|
|
};
|