|
|
|
|
@ -1,11 +1,18 @@ |
|
|
|
|
import { ButtonGroup, Divider } from '@rocket.chat/fuselage'; |
|
|
|
|
import { useLoginServices, useSetting } from '@rocket.chat/ui-contexts'; |
|
|
|
|
import type { ReactElement } from 'react'; |
|
|
|
|
import type { Dispatch, ReactElement, SetStateAction } from 'react'; |
|
|
|
|
import { useTranslation } from 'react-i18next'; |
|
|
|
|
|
|
|
|
|
import type { LoginErrors } from './LoginForm'; |
|
|
|
|
import LoginServicesButton from './LoginServicesButton'; |
|
|
|
|
|
|
|
|
|
const Services = ({ disabled }: { disabled?: boolean }): ReactElement | null => { |
|
|
|
|
const LoginServices = ({ |
|
|
|
|
disabled, |
|
|
|
|
setError, |
|
|
|
|
}: { |
|
|
|
|
disabled?: boolean; |
|
|
|
|
setError: Dispatch<SetStateAction<LoginErrors | undefined>>; |
|
|
|
|
}): ReactElement | null => { |
|
|
|
|
const { t } = useTranslation(); |
|
|
|
|
const services = useLoginServices(); |
|
|
|
|
const showFormLogin = useSetting('Accounts_ShowFormLogin'); |
|
|
|
|
@ -19,10 +26,10 @@ const Services = ({ disabled }: { disabled?: boolean }): ReactElement | null => |
|
|
|
|
{showFormLogin && <Divider mb={24} p={0} children={t('registration.component.form.divider')} />} |
|
|
|
|
<ButtonGroup vertical stretch small> |
|
|
|
|
{services.map((service) => ( |
|
|
|
|
<LoginServicesButton disabled={disabled} key={service.service} {...service} /> |
|
|
|
|
<LoginServicesButton disabled={disabled} key={service.service} {...service} setError={setError} /> |
|
|
|
|
))} |
|
|
|
|
</ButtonGroup> |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
export default Services; |
|
|
|
|
export default LoginServices; |
|
|
|
|
|