import { useCallback } from 'react';
import { IExternalAuthProviderType } from '@growi/core';
import { useTranslation } from 'next-i18next';
const authIcon = {
[IExternalAuthProviderType.google]: google,
[IExternalAuthProviderType.github]: github,
[IExternalAuthProviderType.facebook]: facebook,
[IExternalAuthProviderType.oidc]: openid,
[IExternalAuthProviderType.saml]: key,
};
const authLabel = {
[IExternalAuthProviderType.google]: 'Google',
[IExternalAuthProviderType.github]: 'GitHub',
[IExternalAuthProviderType.facebook]: 'Facebook',
[IExternalAuthProviderType.oidc]: 'OIDC',
[IExternalAuthProviderType.saml]: 'SAML',
};
export const ExternalAuthButton = ({ authType }: {authType: IExternalAuthProviderType}): JSX.Element => {
const { t } = useTranslation();
const key = `btn-auth-${authType.toString()}`;
const btnClass = `btn-auth-${authType.toString()}`;
const handleLoginWithExternalAuth = useCallback(() => {
window.location.href = `/passport/${authType.toString()}`;
}, [authType]);
return (
);
};