@digilogiclabs/create-saas-app 2.8.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/generators/template-generator.js +8 -8
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/templates/shared/quality/web/src/__tests__/accessibility.test.tsx +3 -3
- package/dist/templates/web/ai-platform/template/src/app/page.tsx +207 -207
- package/dist/templates/web/base/template/package.json +1 -3
- package/dist/templates/web/base/template/src/app/auth/callback/route.ts +32 -18
- package/dist/templates/web/base/template/src/app/dashboard/page.tsx +6 -43
- package/dist/templates/web/base/template/src/app/globals.css +158 -157
- package/dist/templates/web/base/template/src/app/page.tsx +2 -2
- package/dist/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +800 -800
- package/dist/templates/web/ui-auth/template/src/app/globals.css +96 -95
- package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +109 -109
- package/dist/templates/web/ui-auth/template/src/app/page.tsx +4 -3
- package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -128
- package/dist/templates/web/ui-auth-ai/template/src/app/globals.css +35 -40
- package/dist/templates/web/ui-auth-ai/template/src/app/layout.tsx +1 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +3 -3
- package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +10 -49
- package/dist/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +800 -800
- package/dist/templates/web/ui-auth-payments/template/src/app/globals.css +212 -211
- package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -109
- package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +350 -350
- package/dist/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +506 -506
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -128
- package/dist/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +143 -143
- package/dist/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +184 -184
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +143 -233
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +10 -50
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +800 -800
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/globals.css +97 -96
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +325 -364
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +389 -532
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +644 -644
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +119 -163
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +158 -201
- package/dist/templates/web/ui-auth-payments-ai-rag/template/package.json +1 -2
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +10 -51
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/globals.css +97 -96
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +402 -403
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +143 -143
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +184 -184
- package/dist/templates/web/ui-auth-payments-video/template/src/app/globals.css +229 -228
- package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +4 -7
- package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +1 -1
- package/dist/templates/web/ui-only/template/src/app/globals.css +43 -42
- package/package.json +1 -1
- package/src/templates/shared/quality/web/src/__tests__/accessibility.test.tsx +3 -3
- package/src/templates/web/ai-platform/template/src/app/page.tsx +207 -207
- package/src/templates/web/base/template/package.json +1 -3
- package/src/templates/web/base/template/src/app/auth/callback/route.ts +32 -18
- package/src/templates/web/base/template/src/app/dashboard/page.tsx +6 -43
- package/src/templates/web/base/template/src/app/globals.css +158 -157
- package/src/templates/web/base/template/src/app/page.tsx +2 -2
- package/src/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +800 -800
- package/src/templates/web/ui-auth/template/src/app/globals.css +96 -95
- package/src/templates/web/ui-auth/template/src/app/login/page.tsx +109 -109
- package/src/templates/web/ui-auth/template/src/app/page.tsx +4 -3
- package/src/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -128
- package/src/templates/web/ui-auth-ai/template/src/app/globals.css +35 -40
- package/src/templates/web/ui-auth-ai/template/src/app/layout.tsx +1 -0
- package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +3 -3
- package/src/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +10 -49
- package/src/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +800 -800
- package/src/templates/web/ui-auth-payments/template/src/app/globals.css +212 -211
- package/src/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -109
- package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +350 -350
- package/src/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +506 -506
- package/src/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -128
- package/src/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +143 -143
- package/src/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +184 -184
- package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +143 -233
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +10 -50
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +800 -800
- package/src/templates/web/ui-auth-payments-ai/template/src/app/globals.css +97 -96
- package/src/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +325 -364
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +389 -532
- package/src/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +644 -644
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +119 -163
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +158 -201
- package/src/templates/web/ui-auth-payments-ai-rag/template/package.json +1 -2
- package/src/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +10 -51
- package/src/templates/web/ui-auth-payments-audio/template/src/app/globals.css +97 -96
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +402 -403
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +143 -143
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +184 -184
- package/src/templates/web/ui-auth-payments-video/template/src/app/globals.css +229 -228
- package/src/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +4 -7
- package/src/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +1 -1
- package/src/templates/web/ui-only/template/src/app/globals.css +43 -42
|
@@ -1,185 +1,185 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import React, { useState, useActionState } from 'react'
|
|
4
|
-
import { Button, Card, Input, Label } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
-
import { useAuth } from '@digilogiclabs/app-sdk'
|
|
6
|
-
import { useRouter } from 'next/navigation'
|
|
7
|
-
import { signUpAction } from '@/lib/actions/auth'
|
|
8
|
-
|
|
9
|
-
export function SignupForm() {
|
|
10
|
-
const [name, setName] = useState('')
|
|
11
|
-
const [email, setEmail] = useState('')
|
|
12
|
-
const [password, setPassword] = useState('')
|
|
13
|
-
const [confirmPassword, setConfirmPassword] = useState('')
|
|
14
|
-
const { signUp, signInWithOAuth, loading, error, user } = useAuth()
|
|
15
|
-
const [actionState, formAction] = useActionState(signUpAction, { success: false })
|
|
16
|
-
const router = useRouter()
|
|
17
|
-
|
|
18
|
-
// Redirect if already logged in
|
|
19
|
-
React.useEffect(() => {
|
|
20
|
-
if (user) {
|
|
21
|
-
router.push('/')
|
|
22
|
-
}
|
|
23
|
-
}, [user, router])
|
|
24
|
-
|
|
25
|
-
const handleSignUp = async (e: React.FormEvent) => {
|
|
26
|
-
e.preventDefault()
|
|
27
|
-
|
|
28
|
-
if (password !== confirmPassword) {
|
|
29
|
-
console.error('Passwords do not match')
|
|
30
|
-
return
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
try {
|
|
34
|
-
await signUp(email, password)
|
|
35
|
-
router.push('/')
|
|
36
|
-
} catch (err) {
|
|
37
|
-
console.error('Sign up error:', err)
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const handleGoogleSignUp = async () => {
|
|
42
|
-
try {
|
|
43
|
-
await signInWithOAuth('google'
|
|
44
|
-
} catch (err) {
|
|
45
|
-
console.error('Google sign up error:', err)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Enhanced form action that uses both server action validation and client auth
|
|
50
|
-
const handleServerAction = async (formData: FormData) => {
|
|
51
|
-
const result = await formAction(formData)
|
|
52
|
-
|
|
53
|
-
if (result?.success) {
|
|
54
|
-
// If server validation passes, proceed with client auth
|
|
55
|
-
const emailValue = formData.get('email') as string
|
|
56
|
-
const passwordValue = formData.get('password') as string
|
|
57
|
-
const nameValue = formData.get('name') as string
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
await signUp(emailValue, passwordValue)
|
|
61
|
-
router.push('/')
|
|
62
|
-
} catch (err) {
|
|
63
|
-
console.error('Sign up error:', err)
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (loading) {
|
|
69
|
-
return (
|
|
70
|
-
<div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
|
|
71
|
-
<div>Loading...</div>
|
|
72
|
-
</div>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
|
|
78
|
-
<Card className="w-full max-w-md p-8">
|
|
79
|
-
<h1 className="text-2xl font-bold text-center mb-6">Sign Up</h1>
|
|
80
|
-
|
|
81
|
-
{/* Server action errors */}
|
|
82
|
-
{actionState?.error && (
|
|
83
|
-
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
84
|
-
{actionState.error}
|
|
85
|
-
</div>
|
|
86
|
-
)}
|
|
87
|
-
|
|
88
|
-
{/* Client auth errors */}
|
|
89
|
-
{error && (
|
|
90
|
-
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
91
|
-
{error.message}
|
|
92
|
-
</div>
|
|
93
|
-
)}
|
|
94
|
-
|
|
95
|
-
<form action={handleServerAction} className="space-y-4">
|
|
96
|
-
<div>
|
|
97
|
-
<Label htmlFor="name">Name</Label>
|
|
98
|
-
<Input
|
|
99
|
-
id="name"
|
|
100
|
-
name="name"
|
|
101
|
-
type="text"
|
|
102
|
-
value={name}
|
|
103
|
-
onChange={(e) => setName(e.target.value)}
|
|
104
|
-
placeholder="Enter your name"
|
|
105
|
-
required
|
|
106
|
-
disabled={loading}
|
|
107
|
-
/>
|
|
108
|
-
{actionState?.fieldErrors?.name && (
|
|
109
|
-
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.name[0]}</p>
|
|
110
|
-
)}
|
|
111
|
-
</div>
|
|
112
|
-
<div>
|
|
113
|
-
<Label htmlFor="email">Email</Label>
|
|
114
|
-
<Input
|
|
115
|
-
id="email"
|
|
116
|
-
name="email"
|
|
117
|
-
type="email"
|
|
118
|
-
value={email}
|
|
119
|
-
onChange={(e) => setEmail(e.target.value)}
|
|
120
|
-
placeholder="Enter your email"
|
|
121
|
-
required
|
|
122
|
-
disabled={loading}
|
|
123
|
-
/>
|
|
124
|
-
{actionState?.fieldErrors?.email && (
|
|
125
|
-
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.email[0]}</p>
|
|
126
|
-
)}
|
|
127
|
-
</div>
|
|
128
|
-
<div>
|
|
129
|
-
<Label htmlFor="password">Password</Label>
|
|
130
|
-
<Input
|
|
131
|
-
id="password"
|
|
132
|
-
name="password"
|
|
133
|
-
type="password"
|
|
134
|
-
value={password}
|
|
135
|
-
onChange={(e) => setPassword(e.target.value)}
|
|
136
|
-
placeholder="Enter your password"
|
|
137
|
-
required
|
|
138
|
-
disabled={loading}
|
|
139
|
-
/>
|
|
140
|
-
{actionState?.fieldErrors?.password && (
|
|
141
|
-
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.password[0]}</p>
|
|
142
|
-
)}
|
|
143
|
-
</div>
|
|
144
|
-
<div>
|
|
145
|
-
<Label htmlFor="confirmPassword">Confirm Password</Label>
|
|
146
|
-
<Input
|
|
147
|
-
id="confirmPassword"
|
|
148
|
-
name="confirmPassword"
|
|
149
|
-
type="password"
|
|
150
|
-
value={confirmPassword}
|
|
151
|
-
onChange={(e) => setConfirmPassword(e.target.value)}
|
|
152
|
-
placeholder="Confirm your password"
|
|
153
|
-
required
|
|
154
|
-
disabled={loading}
|
|
155
|
-
/>
|
|
156
|
-
{actionState?.fieldErrors?.confirmPassword && (
|
|
157
|
-
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.confirmPassword[0]}</p>
|
|
158
|
-
)}
|
|
159
|
-
</div>
|
|
160
|
-
<Button type="submit" className="w-full" disabled={loading}>
|
|
161
|
-
{loading ? 'Signing Up...' : 'Sign Up'}
|
|
162
|
-
</Button>
|
|
163
|
-
<Button
|
|
164
|
-
type="button"
|
|
165
|
-
variant="outline"
|
|
166
|
-
className="w-full"
|
|
167
|
-
onClick={handleGoogleSignUp}
|
|
168
|
-
disabled={loading}
|
|
169
|
-
>
|
|
170
|
-
Sign up with Google
|
|
171
|
-
</Button>
|
|
172
|
-
</form>
|
|
173
|
-
|
|
174
|
-
<div className="mt-4 text-center">
|
|
175
|
-
<p className="text-sm text-gray-600 dark:text-gray-300">
|
|
176
|
-
Already have an account?{' '}
|
|
177
|
-
<a href="/login" className="text-blue-600 hover:underline dark:text-blue-400">
|
|
178
|
-
Sign in
|
|
179
|
-
</a>
|
|
180
|
-
</p>
|
|
181
|
-
</div>
|
|
182
|
-
</Card>
|
|
183
|
-
</div>
|
|
184
|
-
)
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { useState, useActionState } from 'react'
|
|
4
|
+
import { Button, Card, Input, Label } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
+
import { useAuth } from '@digilogiclabs/app-sdk'
|
|
6
|
+
import { useRouter } from 'next/navigation'
|
|
7
|
+
import { signUpAction } from '@/lib/actions/auth'
|
|
8
|
+
|
|
9
|
+
export function SignupForm() {
|
|
10
|
+
const [name, setName] = useState('')
|
|
11
|
+
const [email, setEmail] = useState('')
|
|
12
|
+
const [password, setPassword] = useState('')
|
|
13
|
+
const [confirmPassword, setConfirmPassword] = useState('')
|
|
14
|
+
const { signUp, signInWithOAuth, loading, error, user } = useAuth()
|
|
15
|
+
const [actionState, formAction] = useActionState(signUpAction, { success: false })
|
|
16
|
+
const router = useRouter()
|
|
17
|
+
|
|
18
|
+
// Redirect if already logged in
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
if (user) {
|
|
21
|
+
router.push('/')
|
|
22
|
+
}
|
|
23
|
+
}, [user, router])
|
|
24
|
+
|
|
25
|
+
const handleSignUp = async (e: React.FormEvent) => {
|
|
26
|
+
e.preventDefault()
|
|
27
|
+
|
|
28
|
+
if (password !== confirmPassword) {
|
|
29
|
+
console.error('Passwords do not match')
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
await signUp(email, password)
|
|
35
|
+
router.push('/')
|
|
36
|
+
} catch (err) {
|
|
37
|
+
console.error('Sign up error:', err)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const handleGoogleSignUp = async () => {
|
|
42
|
+
try {
|
|
43
|
+
await signInWithOAuth('google')
|
|
44
|
+
} catch (err) {
|
|
45
|
+
console.error('Google sign up error:', err)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Enhanced form action that uses both server action validation and client auth
|
|
50
|
+
const handleServerAction = async (formData: FormData) => {
|
|
51
|
+
const result = await formAction(formData)
|
|
52
|
+
|
|
53
|
+
if (result?.success) {
|
|
54
|
+
// If server validation passes, proceed with client auth
|
|
55
|
+
const emailValue = formData.get('email') as string
|
|
56
|
+
const passwordValue = formData.get('password') as string
|
|
57
|
+
const nameValue = formData.get('name') as string
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
await signUp(emailValue, passwordValue)
|
|
61
|
+
router.push('/')
|
|
62
|
+
} catch (err) {
|
|
63
|
+
console.error('Sign up error:', err)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (loading) {
|
|
69
|
+
return (
|
|
70
|
+
<div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
|
|
71
|
+
<div>Loading...</div>
|
|
72
|
+
</div>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
|
|
78
|
+
<Card className="w-full max-w-md p-8">
|
|
79
|
+
<h1 className="text-2xl font-bold text-center mb-6">Sign Up</h1>
|
|
80
|
+
|
|
81
|
+
{/* Server action errors */}
|
|
82
|
+
{actionState?.error && (
|
|
83
|
+
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
84
|
+
{actionState.error}
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
87
|
+
|
|
88
|
+
{/* Client auth errors */}
|
|
89
|
+
{error && (
|
|
90
|
+
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
91
|
+
{error.message}
|
|
92
|
+
</div>
|
|
93
|
+
)}
|
|
94
|
+
|
|
95
|
+
<form action={handleServerAction} className="space-y-4">
|
|
96
|
+
<div>
|
|
97
|
+
<Label htmlFor="name">Name</Label>
|
|
98
|
+
<Input
|
|
99
|
+
id="name"
|
|
100
|
+
name="name"
|
|
101
|
+
type="text"
|
|
102
|
+
value={name}
|
|
103
|
+
onChange={(e) => setName(e.target.value)}
|
|
104
|
+
placeholder="Enter your name"
|
|
105
|
+
required
|
|
106
|
+
disabled={loading}
|
|
107
|
+
/>
|
|
108
|
+
{actionState?.fieldErrors?.name && (
|
|
109
|
+
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.name[0]}</p>
|
|
110
|
+
)}
|
|
111
|
+
</div>
|
|
112
|
+
<div>
|
|
113
|
+
<Label htmlFor="email">Email</Label>
|
|
114
|
+
<Input
|
|
115
|
+
id="email"
|
|
116
|
+
name="email"
|
|
117
|
+
type="email"
|
|
118
|
+
value={email}
|
|
119
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
120
|
+
placeholder="Enter your email"
|
|
121
|
+
required
|
|
122
|
+
disabled={loading}
|
|
123
|
+
/>
|
|
124
|
+
{actionState?.fieldErrors?.email && (
|
|
125
|
+
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.email[0]}</p>
|
|
126
|
+
)}
|
|
127
|
+
</div>
|
|
128
|
+
<div>
|
|
129
|
+
<Label htmlFor="password">Password</Label>
|
|
130
|
+
<Input
|
|
131
|
+
id="password"
|
|
132
|
+
name="password"
|
|
133
|
+
type="password"
|
|
134
|
+
value={password}
|
|
135
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
136
|
+
placeholder="Enter your password"
|
|
137
|
+
required
|
|
138
|
+
disabled={loading}
|
|
139
|
+
/>
|
|
140
|
+
{actionState?.fieldErrors?.password && (
|
|
141
|
+
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.password[0]}</p>
|
|
142
|
+
)}
|
|
143
|
+
</div>
|
|
144
|
+
<div>
|
|
145
|
+
<Label htmlFor="confirmPassword">Confirm Password</Label>
|
|
146
|
+
<Input
|
|
147
|
+
id="confirmPassword"
|
|
148
|
+
name="confirmPassword"
|
|
149
|
+
type="password"
|
|
150
|
+
value={confirmPassword}
|
|
151
|
+
onChange={(e) => setConfirmPassword(e.target.value)}
|
|
152
|
+
placeholder="Confirm your password"
|
|
153
|
+
required
|
|
154
|
+
disabled={loading}
|
|
155
|
+
/>
|
|
156
|
+
{actionState?.fieldErrors?.confirmPassword && (
|
|
157
|
+
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.confirmPassword[0]}</p>
|
|
158
|
+
)}
|
|
159
|
+
</div>
|
|
160
|
+
<Button type="submit" className="w-full" disabled={loading}>
|
|
161
|
+
{loading ? 'Signing Up...' : 'Sign Up'}
|
|
162
|
+
</Button>
|
|
163
|
+
<Button
|
|
164
|
+
type="button"
|
|
165
|
+
variant="outline"
|
|
166
|
+
className="w-full"
|
|
167
|
+
onClick={handleGoogleSignUp}
|
|
168
|
+
disabled={loading}
|
|
169
|
+
>
|
|
170
|
+
Sign up with Google
|
|
171
|
+
</Button>
|
|
172
|
+
</form>
|
|
173
|
+
|
|
174
|
+
<div className="mt-4 text-center">
|
|
175
|
+
<p className="text-sm text-gray-600 dark:text-gray-300">
|
|
176
|
+
Already have an account?{' '}
|
|
177
|
+
<a href="/login" className="text-blue-600 hover:underline dark:text-blue-400">
|
|
178
|
+
Sign in
|
|
179
|
+
</a>
|
|
180
|
+
</p>
|
|
181
|
+
</div>
|
|
182
|
+
</Card>
|
|
183
|
+
</div>
|
|
184
|
+
)
|
|
185
185
|
}
|