<script setup lang="ts">
  import { useAuthStore } from "../store/auth";
  import { Input, Button } from 'fp-ts-vue-ui';

  const authStore = useAuthStore();
  const formData = {
    email: '',
    password: '',
    name: ''
  };

  const register = async function () {
    await authStore.SIGN_UP(formData.email, formData.password, formData.name);
    debugger;
  };

</script>

<template>
  <form @submit.prevent="register">
    <Input 
        class="input flex justify-center"
        id="id_name"
        type="text"
        label="Name"
        v-model.lazy="formData.name"
    />

    <Input 
        class="input flex justify-center"
        id="id_email"
        type="text"
        label="Email"
        v-model.lazy="formData.email"
    />

    <Input 
        class="input flex justify-center"
        id="id_password"
        type="password"
        label="Password"
        v-model.lazy="formData.password"
    />
    <Button
        class="mt-5"
        label="Register"
    ></Button>
  </form>
</template>
