"use client"; import { Button, TextField } from "@granity/ui"; import { useRef } from "react"; interface IProps { searchParams?: { [key: string]: string | string[] | undefined }; } type CreateAccountParameters = { username: string; password: string; }; const createAccount = async (params: CreateAccountParameters) => { await fetch("/server/auth/createUser", { method: "POST", headers: { Accept: "application/json", "Content-Type": "application/json", }, body: JSON.stringify(params), }); }; const CreateAccountPage = ({ searchParams }: IProps) => { const userName = useRef(""); const pass = useRef(""); const onSubmit = async () => { await createAccount({ username: userName.current, password: pass.current, }); }; return (
{searchParams?.message}
)}