| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import { useTranslation } from 'react-i18next'
- import { User } from '../../../../../../types/group-management/user'
- import MaterialIcon from '../../../../shared/components/material-icon'
- type ManagedUserStatusProps = {
- user: User
- }
- export default function ManagedUserStatus({ user }: ManagedUserStatusProps) {
- const { t } = useTranslation()
- return (
- <span>
- {user.isEntityAdmin ? (
- <>
- <span className="security-state-group-admin" />
- </>
- ) : (
- <>
- {user.invite ? (
- <span className="security-state-invite-pending">
- <MaterialIcon
- type="schedule"
- category="outlined"
- accessibilityLabel={t('pending_invite')}
- />
-
- {t('managed')}
- </span>
- ) : (
- <>
- {user.enrollment?.managedBy ? (
- <span className="security-state-managed">
- <MaterialIcon
- type="check"
- accessibilityLabel={t('managed')}
- />
-
- {t('managed')}
- </span>
- ) : (
- <span className="security-state-not-managed">
- <MaterialIcon
- type="close"
- accessibilityLabel={t('not_managed')}
- />
-
- {t('managed')}
- </span>
- )}
- </>
- )}
- </>
- )}
- </span>
- )
- }
|