<template>
  <div>
    <slot name="skeleton" v-if="loading">
      <q-skeleton :type="type" v-bind="$attrs" />
    </slot>
    <template v-else>
      <slot />
    </template>
  </div>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';

@Component({})
export default class BlockLoader extends Vue {
  @Prop()
  readonly loading: boolean;

  @Prop()
  readonly type: string;
}
</script>
