<template>
  <div class="pl-loading">
    <div class="pl-loading__spinner" />
    <div class="pl-loading__text">
      {{ text }}...
    </div>
  </div>
</template>

<script>
export default {
  name: 'Loading',
  data() {
    return {
      text: this.$t('LOADING_TEXT'),
    };
  },
};
</script>

<style lang="scss" scoped>
@import '@/vue/styles/tokens.scss';

.pl-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 100px 16px 40px;

  &__spinner {
    width: 64px;
    height: 64px;
    border: 6px solid $c-surface-alt;
    border-top-color: $c-brand;
    border-radius: 50%;
    animation: pl-loading-spin 1s linear infinite;
  }

  &__text {
    font-size: 14px;
    color: $c-text-muted;
  }
}

@keyframes pl-loading-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
</style>
