<template>
  <div>
    <v-form v-if='!sent'>
      <p>Let's set up a new workspace!</p>
      <v-text-field v-model='email' label='E-mail' required/>
      <v-btn @click='submit'>Send confirm mail</v-btn>
    </v-form>
    <div v-else>
      <h1>Check your inbox</h1>
      <p>Confirmation mail was sent. Please continue setup sequence by jumping to the link in the mail.</p>
    </div>
  </div>
</template>
<script>
export default {
  layout: 'gate',
  data() {
    return {
      email: null,
      sent: false
    }
  },
  methods: {
    submit() {
      this.$axios.post('/setup', {
        email: this.email
      }).then(res => {
        this.sent = true;
      });
    }
  },
}
</script>
