import React from 'react';
import { StytchB2B } from '@stytch/nextjs/b2b';
import { AuthFlowType } from '@stytch/vanilla-js';

const LoginOrSignup = () => {
  const config = {
    authFlowType: AuthFlowType.Discovery,
    products: ['oauth', 'emailMagicLinks', 'sso'],
    // Adding auth features is as simple as
    // products: ['oauth', 'emailMagicLinks', 'sso', 'passwords'],

    emailMagicLinksOptions: {
      loginRedirectURL: 'https://stytch.com/authenticate',
      signupRedirectURL: 'https://stytch.com/authenticate',
    },
    ssoOptions: {
      loginRedirectURL: 'https://stytch.com/authenticate',
      signupRedirectURL: 'https://stytch.com/authenticate',
    },
    oauthOptions: {
      providers: [
        {
          type: 'google',
          one_tap: true,
          position: 'floating',
        },
        {
          type: 'github',
        },
      ],
    },
  };

  return <StytchB2B config={config} />;
};