1- import { GithubSignIn } from '@/components/github-sign-in' ;
2- import { GoogleSignIn } from '@/components/google-sign-in' ;
3- import { MagicLinkSignIn } from '@/components/magic-link' ;
1+ import { LoginForm } from '@/components/login-form' ;
42import { env } from '@/env.mjs' ;
53import { auth } from '@/utils/auth' ;
6- import { Accordion , AccordionContent , AccordionItem , AccordionTrigger } from '@comp/ui/accordion' ;
4+ import {
5+ Card ,
6+ CardContent ,
7+ CardDescription ,
8+ CardFooter ,
9+ CardHeader ,
10+ CardTitle ,
11+ } from '@comp/ui/card' ;
712import { Icons } from '@comp/ui/icons' ;
813import type { Metadata } from 'next' ;
914import { headers } from 'next/headers' ;
1015import Link from 'next/link' ;
1116import { redirect } from 'next/navigation' ;
12- import Balancer from 'react-wrap-balancer' ;
1317
1418export const metadata : Metadata = {
1519 title : 'Login | Comp AI' ,
@@ -25,40 +29,6 @@ export default async function Page({
2529 } ) ;
2630 const { inviteCode } = await searchParams ;
2731
28- let preferredSignInOption : React . ReactNode ;
29-
30- if ( env . AUTH_GOOGLE_ID && env . AUTH_GOOGLE_SECRET ) {
31- preferredSignInOption = (
32- < div className = "flex flex-col space-y-2" >
33- < GoogleSignIn inviteCode = { inviteCode } />
34- </ div >
35- ) ;
36- } else {
37- preferredSignInOption = (
38- < div className = "flex flex-col space-y-2" >
39- < MagicLinkSignIn inviteCode = { inviteCode } />
40- </ div >
41- ) ;
42- }
43-
44- let moreSignInOptions : React . ReactNode ;
45-
46- if (
47- env . AUTH_GOOGLE_ID &&
48- env . AUTH_GOOGLE_SECRET &&
49- env . AUTH_GITHUB_ID &&
50- env . AUTH_GITHUB_SECRET
51- ) {
52- moreSignInOptions = (
53- < div className = "flex flex-col space-y-2" >
54- < MagicLinkSignIn inviteCode = { inviteCode } />
55- < GithubSignIn inviteCode = { inviteCode } />
56- </ div >
57- ) ;
58- } else {
59- moreSignInOptions = null ;
60- }
61-
6232 const orgId = session ?. session ?. activeOrganizationId ;
6333
6434 if ( orgId && inviteCode ) {
@@ -69,57 +39,46 @@ export default async function Page({
6939 redirect ( '/' ) ;
7040 }
7141
72- return (
73- < div >
74- < header className = "fixed right-0 left-0 w-full" >
75- < div className = "mt-4 ml-5 md:mt-10 md:ml-10" >
76- < Link href = "/" >
77- < Icons . Logo />
78- </ Link >
79- </ div >
80- </ header >
81-
82- < div className = "flex min-h-screen items-center justify-center overflow-hidden p-6 md:p-0" >
83- < div className = "relative z-20 m-auto flex w-full max-w-[380px] flex-col py-8" >
84- < div className = "relative flex w-full flex-col" >
85- < Balancer >
86- < h1 className = "pb-1 text-3xl font-medium" > Get Started with Comp AI</ h1 >
87- < h2 className = "pb-1 text-xl font-medium" >
88- { 'Automate SOC 2, ISO 27001 and GDPR compliance with AI.' }
89- </ h2 >
90- </ Balancer >
91-
92- < div className = "pointer-events-auto mt-6 mb-6 flex flex-col" >
93- { preferredSignInOption }
42+ const showGoogle = ! ! ( env . AUTH_GOOGLE_ID && env . AUTH_GOOGLE_SECRET ) ;
43+ const showGithub = ! ! ( env . AUTH_GITHUB_ID && env . AUTH_GITHUB_SECRET ) ;
9444
95- < Accordion type = "single" collapsible className = "mt-6 border-t-[1px] pt-2" >
96- { moreSignInOptions && (
97- < AccordionItem value = "item-1" className = "border-0" >
98- < AccordionTrigger className = "flex justify-center space-x-2 text-sm" >
99- < span > More options</ span >
100- </ AccordionTrigger >
101- < AccordionContent className = "mt-4" >
102- < div className = "flex flex-col space-y-4" > { moreSignInOptions } </ div >
103- </ AccordionContent >
104- </ AccordionItem >
105- ) }
106- </ Accordion >
107- </ div >
108-
109- < p className = "text-muted-foreground text-xs" >
45+ return (
46+ < div className = "flex min-h-screen flex-col text-foreground" >
47+ < main className = "flex flex-1 items-center justify-center p-6" >
48+ < Card className = "w-full max-w-lg" >
49+ < CardHeader className = "text-center space-y-3 pt-10" >
50+ < Icons . Logo className = "h-10 w-10 mx-auto" />
51+ < CardTitle className = "text-2xl tracking-tight text-card-foreground" >
52+ Get Started with Comp AI
53+ </ CardTitle >
54+ < CardDescription className = "text-base text-muted-foreground px-4" >
55+ { `Automate SOC 2, ISO 27001 and GDPR compliance with AI.` }
56+ </ CardDescription >
57+ </ CardHeader >
58+ < CardContent className = "space-y-6 pb-6 px-8" >
59+ < LoginForm inviteCode = { inviteCode } showGoogle = { showGoogle } showGithub = { showGithub } />
60+ </ CardContent >
61+ < CardFooter className = "pb-10" >
62+ < p className = "w-full px-6 text-center text-xs text-muted-foreground" >
11063 By clicking continue, you acknowledge that you have read and agree to the{ ' ' }
111- < a href = "https://trycomp.ai/terms-and-conditions" className = "underline" >
64+ < Link
65+ href = "https://trycomp.ai/terms-and-conditions"
66+ className = "underline hover:text-primary"
67+ >
11268 Terms and Conditions
113- </ a > { ' ' }
69+ </ Link > { ' ' }
11470 and{ ' ' }
115- < a href = "https://trycomp.ai/privacy-policy" className = "underline" >
71+ < Link
72+ href = "https://trycomp.ai/privacy-policy"
73+ className = "underline hover:text-primary"
74+ >
11675 Privacy Policy
117- </ a >
76+ </ Link >
11877 .
11978 </ p >
120- </ div >
121- </ div >
122- </ div >
79+ </ CardFooter >
80+ </ Card >
81+ </ main >
12382 </ div >
12483 ) ;
12584}
0 commit comments