summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/loading_icon.vue
blob: 15581d5c2a05fa981f94d3a108f4eb92355ec73a (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
<script>
  export default {
    props: {
      label: {
        type: String,
        required: false,
        default: 'Loading',
      },

      size: {
        type: String,
        required: false,
        default: '1',
      },

      inline: {
        type: Boolean,
        required: false,
        default: false,
      },
    },

    computed: {
      rootElementType() {
        return this.inline ? 'span' : 'div';
      },
      cssClass() {
        return `fa-${this.size}x`;
      },
    },
  };
</script>
<template>
  <component
    :is="this.rootElementType"
    class="text-center">
    <i
      class="fa fa-spin fa-spinner"
      :class="cssClass"
      aria-hidden="true"
      :aria-label="label">
    </i>
  </component>
</template>