<template>
  <form class="box" @submit.prevent="doSignup">
    <b-field label="E-Mail-Adresse">
      <b-input type="email" v-model="user.email" />
    </b-field>
    <b-field label="Kennwort">
      <b-input type="password" v-model="user.password" />
    </b-field>

    <div v-if="false" class="notification is-danger">
      Email or password was wrong.
    </div>

    <div class="buttons">
      <b-button
        native-type="submit"
        type="is-primary"
        style="margin-left: auto; margin-right: 0; order: 10"
      >
        Konto anlegen
      </b-button>
    </div>
  </form>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { User } from "@/api";

@Component
export default class LoginForm extends Vue {
  private user = new User("", "");

  private async doSignup() {
    await this.user.signup();
  }
}
</script>
