All files / src/components LoadingSpinner.vue

100% Statements 4/4
83.33% Branches 5/6
100% Functions 0/0
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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  384x     38x             38x                                       384x    
<template>
  <div v-if="grid" class="row">
    <div class="col-12 text-center" :class="`py-${padding}`">
      <div class="spinner-border text-primary" role="status">
        <span class="visually-hidden">{{ t('common.loading') }}</span>
      </div>
      <p v-if="message" class="text-muted mt-3">{{ message }}</p>
    </div>
  </div>
  <div v-else class="text-center" :class="`py-${padding}`">
    <div class="spinner-border text-primary" role="status">
      <span class="visually-hidden">{{ t('common.loading') }}</span>
    </div>
    <p v-if="message" class="text-muted mt-3">{{ message }}</p>
  </div>
</template>
 
<script setup lang="ts">
import { useUILanguage } from '@/composables/useUILanguage'
 
withDefaults(
  defineProps<{
    // Wraps in the row/col-12 grid used by most list pages; disable for a
    // page that renders the spinner outside a container-fluid/row context.
    grid?: boolean
    padding?: number
    message?: string
  }>(),
  { grid: true, padding: 4, message: undefined }
)
 
const { t } = useUILanguage()
</script>