diff --git a/services/web/frontend/js/features/group-management/components/managed-users/managed-user-status.tsx b/services/web/frontend/js/features/group-management/components/managed-users/managed-user-status.tsx index 16d9a5c2fd..ea46b60952 100644 --- a/services/web/frontend/js/features/group-management/components/managed-users/managed-user-status.tsx +++ b/services/web/frontend/js/features/group-management/components/managed-users/managed-user-status.tsx @@ -7,49 +7,40 @@ type ManagedUserStatusProps = { } export default function ManagedUserStatus({ user }: ManagedUserStatusProps) { const { t } = useTranslation() - return ( - - {user.isEntityAdmin ? ( - <> - - - ) : ( - <> - {user.invite ? ( - - -   - {t('managed')} - - ) : ( - <> - {user.enrollment?.managedBy ? ( - - -   - {t('managed')} - - ) : ( - - -   - {t('managed')} - - )} - - )} - - )} + const managedUserInvite = ( + + +   + {t('managed')} ) + + const managedUserAccepted = ( + + +   + {t('managed')} + + ) + const managedUserNotAccepted = ( + + +   + {t('managed')} + + ) + + if (user.isEntityAdmin) { + return + } + if (user.invite) { + return managedUserInvite + } + return user.enrollment?.managedBy + ? managedUserAccepted + : managedUserNotAccepted } diff --git a/services/web/frontend/js/features/group-management/components/managed-users/sso-status.tsx b/services/web/frontend/js/features/group-management/components/managed-users/sso-status.tsx index 328f1af3d5..f1165a9308 100644 --- a/services/web/frontend/js/features/group-management/components/managed-users/sso-status.tsx +++ b/services/web/frontend/js/features/group-management/components/managed-users/sso-status.tsx @@ -7,35 +7,32 @@ type SSOStatusProps = { } export default function SSOStatus({ user }: SSOStatusProps) { const { t } = useTranslation() - return ( - - {user.invite ? ( - - -   {t('sso')} - - ) : ( - <> - {user.enrollment?.sso ? ( - - -   {t('sso')} - - ) : ( - - -   {t('sso')} - - )} - - )} + const invitedSSO = ( + + +   {t('sso')} ) + const acceptedSSO = ( + + +   {t('sso')} + + ) + const notAcceptedSSO = ( + + +   {t('sso')} + + ) + + if (user.invite) { + return invitedSSO + } + + return user.enrollment?.sso ? acceptedSSO : notAcceptedSSO }