removeMember(member)}
member={member}
user={user}
/>
);
};
const TeamRoleSelect = (props: {
hasWriteAccess: boolean;
member: TeamMember;
organization: Organization;
updateMemberRole: (member: TeamMember, newRole: string) => void;
}) => {
const {hasWriteAccess, organization, member, updateMemberRole} = props;
const {orgRoleList, teamRoleList, features} = organization;
if (!features.includes('team-roles')) {
return null;
}
const {orgRole: orgRoleId} = member;
const orgRole = orgRoleList.find(r => r.id === orgRoleId);
const teamRoleId = member.teamRole || orgRole?.minimumTeamRole;
const teamRole = teamRoleList.find(r => r.id === teamRoleId) || teamRoleList[0];
if (
!hasWriteAccess ||
hasOrgRoleOverwrite({orgRole: orgRoleId, orgRoleList, teamRoleList})
) {
return (