<script setup>
import { addVehicleUser } from "@/components/session/user/UserVehicleRequest.vue";
import { clearErrors } from "@/components/request/HandleGlobalError.vue";
import { ref } from "vue";
import ShowErrorField from "@/components/global/ShowErrorField.vue";

const reg = ref("");
const type = ref("");
const notes = ref("");

</script>

<template>
  <form @submit.prevent="clearErrors(); addVehicleUser(reg, type, notes)">
    <div class="field">
      <label class="label">Registreringsnummer (Nummerplade)</label>
      <div class="control">
        <input class="input" type="text" placeholder="Reg" v-model="reg">
      </div>
    </div>
    <div class="field">
      <label class="label">Type</label>
      <div class="control">
        <input class="input" type="text" placeholder="Type" v-model="type">
      </div>
    </div>
    <div class="field">
      <label class="label">Notes</label>
      <div class="control">
        <input class="input" type="text" placeholder="Notes" v-model="notes">
      </div>
    </div>
    <ShowErrorField error="addVehicleUser" />
    <div class="field">
      <div class="control">
        <button class="button is-dark">Tilføj køretøj</button>
      </div>
    </div>
  </form>
</template>

<style scoped>

</style>