import React from 'react';
import { ListView } from 'patternfly-react';
import PaginationWrapper from 'foremanReact/components/Pagination/PaginationWrapper';
import { reject } from 'lodash';
import PropTypes from 'prop-types';
import AnsibleRole from './AnsibleRole';
const AssignedRolesList = ({
assignedRoles,
pagination,
itemCount,
onPaginationChange,
onRemoveRole,
resourceName,
}) => {
const directlyAssignedRoles = reject(assignedRoles, role => role.inherited);
return (
{assignedRoles.map(role => (
))}
{directlyAssignedRoles.map(role => (
))}
);
};
AssignedRolesList.propTypes = {
assignedRoles: PropTypes.arrayOf(PropTypes.object).isRequired,
pagination: PropTypes.shape({
page: PropTypes.number,
perPage: PropTypes.number,
}).isRequired,
itemCount: PropTypes.number.isRequired,
onPaginationChange: PropTypes.func.isRequired,
onRemoveRole: PropTypes.func.isRequired,
resourceName: PropTypes.string.isRequired,
};
export default AssignedRolesList;