<template>
    <form @submit.prevent="submit">
        
        <div class="form-group row">
          <div class="col-md-6">
            <label for="surname">Surname</label>
            <input type="text" class="form-control" surname="surname" id="surname" v-model="fields.surname" placeholder="Enter surname..."/>
            <div v-if="errors && errors.surname" class="text-danger">{{ errors.surname[0] }}</div>
          </div>
	
          <div class="col-md-6">
            <label for="othername">Othername(s)</label>
            <input type="othername" class="form-control" name="othername" id="othername" v-model="fields.othername" placeholder="Enter othername..."/>
            <div v-if="errors && errors.othername" class="text-danger">{{ errors.othername[0] }}</div>
          </div>

          <div class="col-md-6">
            <label for="username">Username</label>
            <input type="username" class="form-control" name="username" id="username" v-model="fields.username" placeholder="Enter username..."/>
            <div v-if="errors && errors.username" class="text-danger">{{ errors.username[0] }}</div>
          </div> 

          <div class="col-md-6">
            <label for="password">Password</label>
            <input type="password" class="form-control" name="password" id="password" v-model="fields.password" placeholder="Enter password..."/>
            <div v-if="errors && errors.password" class="text-danger">{{ errors.password[0] }}</div>
          </div>
        </div>
        <div class="form-group">
            <button type="submit" class="btn btn-success btn-round">Save</button>
            <button type="reset" class="btn btn-danger btn-round">Clear</button>
        </div>       
        

        
    </form>
</template>

<script>
import FormMixin from '../shared/FormMixin';

export default {
  mixins: [ FormMixin ],

  data() {
    return {
      'action': '/bmp/admin/storeAdmin',
      'text': 'Admin added succesfully',
      'redirect': '/bmp/admin/admin-user'
    }
  }
}

</script>