import { Row, Col, ListGroup, Container, Form } from 'react-bootstrap'; import { assigned, available, effective } from '../mock'; import { useState } from 'react'; function RoleMapping() { const [availableRoles, setAvailableRoles] = useState(available); const [assignedRoles, setAssignedRoles] = useState(assigned); const [effectiveRoles, setEffectiveRoles] = useState(effective); const filteredRole = (selectedRole, setRoles) => { setRoles((roles) => roles.filter((role) => role.id !== selectedRole.id)); }; const appendRole = (selectedRole, setRoles) => { setRoles((roles) => [...roles, selectedRole]); }; return (

Realm Roles

Available Roles

{availableRoles.map((role) => ( { filteredRole(role, setAvailableRoles); appendRole(role, setAssignedRoles); appendRole(role, setEffectiveRoles); }} > {role.data} ))}

Assigned Roles

{assignedRoles.map((role) => ( { appendRole(role, setAvailableRoles); filteredRole(role, setAssignedRoles); filteredRole(role, setEffectiveRoles); }} > {role.data} ))}

Effective Roles

{effectiveRoles.map((role) => ( {role.data} ))}

Client Roles

{availableRoles.map((role) => ( ))}
); } export default RoleMapping;