"use client" import { useState } from "react" import { Mail, User, Lock } from "lucide-react" import ErrorToast from "@/components/Error" import { useRouter } from "next/navigation" import axios from "axios" export default function SetupPage() { const router = useRouter() const [step, setStep] = useState(1) const [email, setEmail] = useState("") const [username, setUsername] = useState("") const [name, setName] = useState("") const [password, setPassword] = useState("") const [passwordConfirm, setPasswordConfirm] = useState("") const [error, setError] = useState("") const handleNextStep = () => { setStep(2) } const handlePreviousStep = () => { setStep(1) } const handleComplete = async () => { if (password !== passwordConfirm) { setError("Passwords do not match") return } try { const response = await axios.post("/api/user/create", { email, username, name, password }) if (response.status === 201) { router.push("/") } } catch (error: any) { setError(error.response.data.error) } } return (
  • Create account
  • Next Steps
{step === 1 && (

Create account

Please create an account to get started.

Email
Enter valid email address
Username
Enter valid username
Full Name
Enter valid full name
Password
Enter valid password
Repeat Password
Enter valid repeat password
)} {step === 2 && (

Next Steps

Here are some next steps to get you started

1. Click Complete to finish the setup & create the user

2. Create a site with a network

3. Add your first server to the network

4. Add all your self-hosted applications to the server

5. Setup notifications to be notified about any issues

6. Leave a star on GitHub if you like it

)}
setError("")} />
) }