<template>
  <div :class="loading ? 'skeleton-block' : ''">
    <Message v-if="message" :type="type">{{ message }}</Message>
    <slot v-if="!loading && !message" />
  </div>
</template>

<script lang="ts">
import Message from './Message.vue'

export default {
  name: 'Loading',
  components: {
    Message,
  },
  props: {
    loading: {
      type: Boolean,
      default: true,
    },
    message: {
      type: String,
      default: '',
    },
    type: {
      type: String,
      default: 'info',
    },
  },
}
</script>
