<template>
  <v-col
    :cols="xs"
    :sm="sm || xs"
    :md="md || sm || xs"
    :lg="lg || md || sm || xs"
    :xl="xl || lg || md || sm || xs"
    :xxl="xxl || xl || lg || md || sm || xs"
    :class="$attrs.class + ' px-2'"
  >
    <v-file-input
      v-model="files"
      variant="solo"
      :label="label"
      :name="name"
      prepend-icon="mdi-paperclip"
    />
  </v-col>
</template>

<script lang="ts" setup>
import { ref, watch } from "vue";

defineProps({
  name: {
    type: String,
    requird: true
  },

  label: {
    type: String,
    required: true
  },

  xs: { type: String, default: "12" },
  sm: { type: String },
  md: { type: String },
  lg: { type: String },
  xl: { type: String },
  xxl: { type: String }
});
const files = ref<File[]>([]);

const emit = defineEmits(["update:modelValue"]);

watch(files, newFiles => {
  emit("update:modelValue", newFiles);
});
</script>
