mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-15 02:40:56 -05:00
aa480a2663
[web] migrate from window attributes to getMeta GitOrigin-RevId: 3dcf1ab6b01155e5e4abeb3e78d0fa9053e055bc
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import { RowLink } from '@/features/subscription/components/dashboard/row-link'
|
|
import getMeta from '@/utils/meta'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { ManagedGroupSubscription } from '../../../../../../types/subscription/dashboard/subscription'
|
|
|
|
export default function GroupSettingsButton({
|
|
subscription,
|
|
}: {
|
|
subscription: ManagedGroupSubscription
|
|
}) {
|
|
const { t } = useTranslation()
|
|
|
|
const { groupSSOEnabled } = getMeta('ol-ExposedSettings')
|
|
|
|
const subscriptionHasManagedUsers =
|
|
subscription.features?.managedUsers !== false
|
|
const subscriptionHasGroupSSO =
|
|
subscription.features?.groupSSO === true ||
|
|
(groupSSOEnabled && subscription.features?.groupSSO === null)
|
|
|
|
let groupSettingRowSubText = ''
|
|
if (subscriptionHasGroupSSO && subscriptionHasManagedUsers) {
|
|
groupSettingRowSubText = t('manage_group_settings_subtext')
|
|
} else if (subscriptionHasGroupSSO) {
|
|
groupSettingRowSubText = t('manage_group_settings_subtext_group_sso')
|
|
} else if (subscriptionHasManagedUsers) {
|
|
groupSettingRowSubText = t('manage_group_settings_subtext_managed_users')
|
|
}
|
|
|
|
return (
|
|
<RowLink
|
|
href={`/manage/groups/${subscription._id}/settings`}
|
|
heading={t('manage_group_settings')}
|
|
subtext={groupSettingRowSubText}
|
|
icon="settings"
|
|
/>
|
|
)
|
|
}
|