<template>
  <view class="cs-empty" :style="{ marginTop: marginTop + 'rpx', height }">
    <image
      class="empty-image"
      src="/static/images/emty.png"
      mode="aspectFit"
    />
    <text class="empty-text">{{ text }}</text>
    <slot></slot>
  </view>
</template>

<script>
export default {
  name: 'cs-empty',
  props: {
    // 显示的文字
    text: {
      type: String,
      default: '暂无数据'
    },
    // 上边距
    marginTop: {
      type: Number,
      default: 0
    },
    height: {
      type: String,
      default: '856rpx'
    }
  }
}
</script>

<style lang="scss" scoped>
.cs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #fff;

  border-radius: 24rpx;
  gap: 24rpx;
  .empty-image {
    width: 158rpx;
    height: 158rpx;
  }
  .empty-text {
    font-size: 32rpx;
    color: #99a1b7;
  }
}
</style>