All files / app/(dynamic)/(pages)/account/login page.tsx

100% Statements 4/4
100% Branches 2/2
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37                      16x   6x 6x   6x                                        
'use client'
import { useSearchParams } from 'next/navigation'
import isAuth from '../../../../../components/Auth/isAuth'
import { Route } from '../../../../../components/ButtonsAndLinks/Route/Route'
import { AccountForm } from '../../../../../components/Form/AccountForm/AccountForm'
import { Headline } from '../../../../../components/Headline/Headline'
import { routes } from '../../../../../services/routes/routes'
 
/**
 * Login Page
 */
const Login = () => {
	// Url Params
	const searchParams = useSearchParams()
	const callbackUrl = searchParams.get('callbackUrl')
 
	return (
		<div className="container mt-10 md:mt-32 md:w-1/2 2xl:w-1/3">
			<div className="mb-5 text-center md:mb-10">
				<Headline>Willkommen zurück!</Headline>
				<p>In ihren Account einloggen.</p>
			</div>
 
			<AccountForm type="login" />
 
			<div className="flex items-baseline justify-center gap-2 text-sm">
				<p className="font-medium text-gray-500">Noch keinen Account?</p>
				<Route href={routes.account.register({ callbackUrl: callbackUrl ?? '' })} kind="tertiary">
					Jetzt Registrieren
				</Route>
			</div>
		</div>
	)
}
 
export default isAuth(Login, 'guest')