<template>
  <view v-if="loading" :class="skeletonClass" :style="skeletonStyle">
    <sar-skeleton-avatar
      v-if="avatar"
      :animated="animated"
      :size="avatarSize"
      :round="avatarRound"
    />

    <view :class="bem.e('content')">
      <sar-skeleton-title v-if="title" :animated="animated" :round="round" />
      <sar-skeleton-paragraph
        :rows="rows"
        :animated="animated"
        :round="round"
      />
    </view>
  </view>
  <slot v-else></slot>
</template>

<script lang="ts">
import { defineComponent as _defineComponent } from "vue";
import { computed } from "vue";
import { classNames, stringifyStyle, createBem } from "../utils";
import SarSkeletonAvatar from "../skeleton-avatar/skeleton-avatar.vue";
import SarSkeletonTitle from "../skeleton-title/skeleton-title.vue";
import SarSkeletonParagraph from "../skeleton-paragraph/skeleton-paragraph.vue";
import { skeletonProps } from "./common";
const __default__ = {
  options: {
    virtualHost: true,
    styleIsolation: "shared"
  }
};
export default /* @__PURE__ */ _defineComponent({
  ...__default__,
  __name: "skeleton",
  props: skeletonProps,
  setup(__props, { expose: __expose }) {
    __expose();
    const props = __props;
    const bem = createBem("skeleton");
    const skeletonClass = computed(() => {
      return classNames(bem.b(), props.rootClass);
    });
    const skeletonStyle = computed(() => {
      return stringifyStyle(props.rootStyle);
    });
    const __returned__ = { props, bem, skeletonClass, skeletonStyle, SarSkeletonAvatar, SarSkeletonTitle, SarSkeletonParagraph };
    return __returned__;
  }
});
</script>

<style lang="scss">
@use './index.scss';
</style>