summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/loading_icon.vue
blob: db22c5f02cd5777ef83effa765965fd90d923200 (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
<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="rootElementType"
    class="loading-container text-center">
    <i
      :class="cssClass"
      :aria-label="label"
      class="fa fa-spin fa-spinner"
      aria-hidden="true"
    >
    </i>
  </component>
</template>