mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
665f5e37c4
[web] Modular members management table refactoring GitOrigin-RevId: 9a3a00a32970e78e5b43b3a68621a627c490c728
38 lines
1 KiB
TypeScript
38 lines
1 KiB
TypeScript
import { useTranslation } from 'react-i18next'
|
|
import { User } from '../../../../../../types/group-management/user'
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
|
|
type SSOStatusProps = {
|
|
user: User
|
|
}
|
|
export default function SSOStatus({ user }: SSOStatusProps) {
|
|
const { t } = useTranslation()
|
|
const invitedSSO = (
|
|
<span className="security-state-invite-pending">
|
|
<MaterialIcon
|
|
type="schedule"
|
|
category="outlined"
|
|
accessibilityLabel={t('pending_invite')}
|
|
/>
|
|
{t('sso')}
|
|
</span>
|
|
)
|
|
const acceptedSSO = (
|
|
<span className="security-state-managed">
|
|
<MaterialIcon type="check" accessibilityLabel={t('sso_active')} />
|
|
{t('sso')}
|
|
</span>
|
|
)
|
|
const notAcceptedSSO = (
|
|
<span className="security-state-not-managed">
|
|
<MaterialIcon type="close" accessibilityLabel={t('sso_not_active')} />
|
|
{t('sso')}
|
|
</span>
|
|
)
|
|
|
|
if (user.invite) {
|
|
return invitedSSO
|
|
}
|
|
|
|
return user.enrollment?.sso ? acceptedSSO : notAcceptedSSO
|
|
}
|