<template>
  <div class="bg-card">
    <div class="card-header">
      <slot name="title">
        <h3 class="card-title text-clip">
          <span class="title-icon" v-if="icon">
            <bg-icon :icon="icon" />
          </span>
          <span class="easy-icon" v-if="easyIcon"></span>
          <span class="title-text">{{ title }}</span>
          <span class="subtitle-text" v-if="subTitle">{{ subTitle }}</span>
        </h3>
      </slot>
      <slot name="title-extra"></slot>
    </div>
    <div class="card-content" ref="content">
      <slot />
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  title: {
    type: String,
    default: "",
  },
  subTitle:{
    type: String,
    default: "",
  },
  icon: {
    type: String,
    default: "",
  },
  easyIcon:{
    type:Boolean,
    default:false,
  }
})
</script>

<style scoped>
.easy-icon{
  width: 4px;
	height: 14px;
	background-color: #3759be;
	border-radius: 2px;
  margin-right: 8px;
}
.subtitle-text{
  font-size: 14px;
	color: #909bb6;
  font-weight: 400;
  line-height: 5px;
  margin-top: 4px;
}
</style>