<template>
  <view :class="resultClass" :style="resultStyle">
    <slot name="icon">
      <view :class="iconClass">
        <sar-icon
          :name="mapStatusIcon[status]"
          :family="iconFamily"
          :color="iconColor"
        />
      </view>
    </slot>

    <view v-if="title" :class="bem.e('title')">
      <slot name="title">{{ title }}</slot>
    </view>

    <view v-if="title" :class="bem.e('description')">
      <slot name="description">{{ description }}</slot>
    </view>

    <view v-if="$slots.default" :class="bem.e('extra')"><slot></slot></view>
  </view>
</template>

<script lang="ts">
import { defineComponent as _defineComponent } from "vue";
import { computed } from "vue";
import { classNames, stringifyStyle, createBem } from "../utils";
import SarIcon from "../icon/icon.vue";
import { resultProps, mapStatusIcon } from "./common";
const __default__ = {
  options: {
    virtualHost: true,
    styleIsolation: "shared"
  }
};
export default /* @__PURE__ */ _defineComponent({
  ...__default__,
  __name: "result",
  props: resultProps,
  setup(__props, { expose: __expose }) {
    __expose();
    const props = __props;
    const bem = createBem("result");
    const resultClass = computed(() => {
      return classNames(bem.b(), props.rootClass);
    });
    const resultStyle = computed(() => {
      return stringifyStyle(props.rootStyle);
    });
    const iconClass = computed(() => {
      return classNames(bem.e("icon"), bem.em("icon", props.status));
    });
    const __returned__ = { props, bem, resultClass, resultStyle, iconClass, SarIcon, get mapStatusIcon() {
      return mapStatusIcon;
    } };
    return __returned__;
  }
});
</script>

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