aboutsummaryrefslogtreecommitdiff
path: root/src/components/importer/importer.vue
blob: 5df238e2a3dd9654b812ab192205adddba45edf3 (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
<template>
  <div class="importer">
    <form>
      <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>
    <button
      v-if="success"
      class="button-unstyled"
      @click="dismiss"
    >
      <FAIcon
        icon="times"
      />
      <p>{{ successMessage || $t('importer.success') }}</p>
    </button>
    <button
      v-else-if="error"
      class="button-unstyled"
      @click="dismiss"
    >
      <FAIcon
        icon="times"
      />
      <p>{{ errorMessage || $t('importer.error') }}</p>
    </button>
  </div>
</template>

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

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