overleaf/services/web/frontend/js/features/group-management/components/managed-users/managed-user-status.tsx
June Kelly a14e2aecfb Merge pull request #13483 from overleaf/jk-managed-users-group-management-ui
[web] Managed Users: Update Group Member Management UI

GitOrigin-RevId: 6896951927f0e3220db59dda208d7cfe9c6c309e
2023-07-17 10:46:16 +00:00

56 lines
1.5 KiB
TypeScript

import { useTranslation } from 'react-i18next'
import { User } from '../../../../../../types/group-management/user'
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">
<i
className="fa fa-clock-o"
aria-hidden="true"
aria-label={t('pending_invite')}
/>
&nbsp;
{t('managed')}
</span>
) : (
<>
{user.enrollment?.managedBy ? (
<span className="security-state-managed">
<i
className="fa fa-check"
aria-hidden="true"
aria-label={t('managed')}
/>
&nbsp;
{t('managed')}
</span>
) : (
<span className="security-state-not-managed">
<i
className="fa fa-times"
aria-hidden="true"
aria-label={t('not_managed')}
/>
&nbsp;
{t('managed')}
</span>
)}
</>
)}
</>
)}
</span>
)
}