2023-10-19 08:51:33 -04:00
|
|
|
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()
|
2023-10-25 07:10:25 -04:00
|
|
|
const invitedSSO = (
|
|
|
|
<span className="security-state-invite-pending">
|
|
|
|
<MaterialIcon
|
|
|
|
type="schedule"
|
|
|
|
category="outlined"
|
|
|
|
accessibilityLabel={t('pending_invite')}
|
|
|
|
/>
|
|
|
|
{t('sso')}
|
2023-10-19 08:51:33 -04:00
|
|
|
</span>
|
|
|
|
)
|
2023-10-25 07:10:25 -04:00
|
|
|
const acceptedSSO = (
|
|
|
|
<span className="security-state-managed">
|
|
|
|
<MaterialIcon type="check" accessibilityLabel={t('sso_linked')} />
|
|
|
|
{t('sso')}
|
|
|
|
</span>
|
|
|
|
)
|
|
|
|
const notAcceptedSSO = (
|
|
|
|
<span className="security-state-not-managed">
|
|
|
|
<MaterialIcon type="close" accessibilityLabel={t('sso_unlinked')} />
|
|
|
|
{t('sso')}
|
|
|
|
</span>
|
|
|
|
)
|
|
|
|
|
|
|
|
if (user.invite) {
|
|
|
|
return invitedSSO
|
|
|
|
}
|
|
|
|
|
|
|
|
return user.enrollment?.sso ? acceptedSSO : notAcceptedSSO
|
2023-10-19 08:51:33 -04:00
|
|
|
}
|