import { FormEventHandler, useEffect } from "react";
import GuestLayout from "@/layouts/guest-layout";
import { Head, Link, useForm } from "@inertiajs/react";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { InputError } from "@/components/ui/input-error";
export default function Register() {
const { data, setData, post, processing, errors, reset } = useForm({
name: "",
email: "",
password: "",
password_confirmation: "",
});
useEffect(() => {
return () => {
reset("password", "password_confirmation");
};
}, []);
const submit: FormEventHandler = (e) => {
e.preventDefault();
post(route("register"));
};
return (