import { Amplify } from 'aws-amplify'; import { withAuthenticator, WithAuthenticatorProps, } from '@aws-amplify/ui-react'; import '@aws-amplify/ui-react/styles.css'; import awsExports from './aws-exports'; Amplify.configure(awsExports); interface Props extends WithAuthenticatorProps { isPassedToWithAuthenticator: boolean; } function App({ isPassedToWithAuthenticator, signOut, user }: Props) { if (!isPassedToWithAuthenticator) { throw new Error(`isPassedToWithAuthenticator was not provided`); } return ( <>

Hello {user?.username}

); } export default withAuthenticator(App); export async function getStaticProps() { return { props: { isPassedToWithAuthenticator: true, }, }; }