<template>
  <Datepicker
    v-model="time"
    :placeholder="placeholder"
    :format="format"
    timePicker
    textInput
    :autoApply="configuration?.autoApply ?? true"
  />
</template>

<script>
import Datepicker from "@vuepic/vue-datepicker";

export default {
  name: "InputTimePicker",
  props: {
    type: { type: String, required: false, default: "date" },
    format: { type: String, required: false, default: "HH:mm" },
    value: { type: Object, required: false, default: null },
    placeholder: { type: String, required: false, default: null },
    configuration: { type: Object, required: false, default: null },
  },
  data() {
    return {
      time: null,
    };
  },
  components: {
    Datepicker,
  },
  watch: {
    value(value) {
      this.time = value;
    },
  },
};
</script>
