<i18n>
{
  "en": {
    "ResourcesErrorForm": {
      "label": "Upload resulted with an error",
      "next": "Next"
    }
  },
  "ru": {
    "ResourcesErrorForm": {
      "label": "Во время загрузки произошла ошибка",
      "next": "Далее"
    }
  }
}
</i18n>
<template>
  <q-form class="q-gutter-y-md" @submit="submit">
    <div class="text-h6">{{ $t('ResourcesErrorForm.label') }}:</div>
    <div class="text-h6">{{ errorMessage }}</div>
    <q-btn
      color="primary"
      :label="$t('ResourcesErrorForm.next')"
      type="submit"
    />
  </q-form>
</template>

<script lang="ts">
// @ts-nocheck
export default {
  props: ['input-data'],
  data() {
    return {
      errorMessage: '',
    };
  },
  computed: {
    outputData() {
      return {};
    },
  },
  watch: {
    inputData: {
      handler: function (val) {
        this.errorMessage = val.body.error || val.body.message;
      },
    },
  },
  methods: {
    submit(e) {
      this.$emit('submit', e, this.outputData);
    },
  },
};
</script>
