import React from 'react'; import { GetServerSideProps } from 'next'; import AuthLayout from '../../src/components/layout/AuthLayout'; import Splash from '../../src/components/pages/auth/Splash'; import SignUp from '../../src/components/pages/auth/SignUp'; import { SignUpProps } from '../../src/model/components/signUp'; import getDepartments from '../../src/utils/api/getDepartments'; import getTeams from '../../src/utils/api/getTeams'; import getCustomSettings from '../../src/utils/api/getSettings'; import SignUpClosed from '../../src/components/pages/auth/SignUpClosed'; const showSplash = false; const showSignUp = true; const signUp: React.FC = ({ departments, teams, registerOpen, }) => ( {registerOpen ? ( <> {showSplash ? : null} {showSignUp && !showSplash ? ( ) : null} ) : ( )} ); export const getServerSideProps: GetServerSideProps = async () => { const customSettings = await getCustomSettings(); const departments = await getDepartments(); const teams = await getTeams(); const availableTeams = teams.filter( (team) => team.users.length < customSettings.teamLength, ); return { props: { departments, teams: availableTeams, registerOpen: customSettings?.registerOpen, }, }; }; export default signUp;