"use client"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { useState } from "react"; import Image from "next/image"; import { Loader2, X } from "lucide-react"; import { useRouter } from "next/navigation"; export function SignUp() { const [firstName, setFirstName] = useState(""); const [lastName, setLastName] = useState(""); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [passwordConfirmation, setPasswordConfirmation] = useState(""); const [image, setImage] = useState(null); const [imagePreview, setImagePreview] = useState(null); const router = useRouter(); const handleImageChange = (e: React.ChangeEvent) => { const file = e.target.files?.[0]; if (file) { setImage(file); const reader = new FileReader(); reader.onloadend = () => { setImagePreview(reader.result as string); }; reader.readAsDataURL(file); } }; const [loading, setLoading] = useState(false); return ( Sign Up Enter your information to create an account
{ setFirstName(e.target.value); }} value={firstName} />
{ setLastName(e.target.value); }} value={lastName} />
{ setEmail(e.target.value); }} value={email} />
setPassword(e.target.value)} autoComplete="new-password" placeholder="Password" />
setPasswordConfirmation(e.target.value)} autoComplete="new-password" placeholder="Confirm Password" />
{imagePreview && (
Profile preview
)}
{imagePreview && ( { setImage(null); setImagePreview(null); }} /> )}

Secured by better-auth.

); } async function convertImageToBase64(file: File): Promise { return new Promise((resolve, reject) => { const reader = new FileReader(); reader.onloadend = () => resolve(reader.result as string); reader.onerror = reject; reader.readAsDataURL(file); }); } export const signUpString = `"use client"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { useState } from "react"; import Image from "next/image"; import { Loader2, X } from "lucide-react"; import { signUp } from "@/lib/auth-client"; import { toast } from "sonner"; import { useRouter } from "next/navigation"; export function SignUp() { const [firstName, setFirstName] = useState(""); const [lastName, setLastName] = useState(""); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [passwordConfirmation, setPasswordConfirmation] = useState(""); const [image, setImage] = useState(null); const [imagePreview, setImagePreview] = useState(null); const router = useRouter(); const [loading, setLoading] = useState(false); const handleImageChange = (e: React.ChangeEvent) => { const file = e.target.files?.[0]; if (file) { setImage(file); const reader = new FileReader(); reader.onloadend = () => { setImagePreview(reader.result as string); }; reader.readAsDataURL(file); } }; return ( Sign Up Enter your information to create an account
{ setFirstName(e.target.value); }} value={firstName} />
{ setLastName(e.target.value); }} value={lastName} />
{ setEmail(e.target.value); }} value={email} />
setPassword(e.target.value)} autoComplete="new-password" placeholder="Password" />
setPasswordConfirmation(e.target.value)} autoComplete="new-password" placeholder="Confirm Password" />
{imagePreview && (
Profile preview
)}
{imagePreview && ( { setImage(null); setImagePreview(null); }} /> )}

Secured by better-auth.

); } async function convertImageToBase64(file: File): Promise { return new Promise((resolve, reject) => { const reader = new FileReader(); reader.onloadend = () => resolve(reader.result as string); reader.onerror = reject; reader.readAsDataURL(file); }); }`;