aboutsummaryrefslogtreecommitdiff
path: root/src/components/importer/importer.vue
blob: 88b3f4fede0c8059bc1ba844e21d5e86bef94eb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<template>
  <div class="importer">
    <form>
      <input
        class="input"
        ref="input"
        type="file"
        @change="change"
      >
    </form>
    <FAIcon
      v-if="submitting"
      class="importer-uploading"
      spin
      icon="circle-notch"
    />
    <button
      v-else
      class="btn button-default"
      @click="submit"
    >
      {{ submitButtonLabel || $t('importer.submit') }}
    </button>
    <div v-if="success">
      <button
        class="button-unstyled"
        @click="dismiss"
      >
        <FAIcon
          icon="times"
        />
      </button>
      {{ ' ' }}
      <span>{{ successMessage || $t('importer.success') }}</span>
    </div>
    <div v-else-if="error">
      <button
        class="button-unstyled"
        @click="dismiss"
      >
        <FAIcon
          icon="times"
        />
      </button>
      {{ ' ' }}
      <span>{{ errorMessage || $t('importer.error') }}</span>
    </div>
  </div>
</template>

<script src="./importer.js"></script>

<style lang="scss">
.importer {
  &-uploading {
    font-size: 1.5em;
    margin: 0.25em;
  }
}
</style>