<script setup lang="ts">
defineProps<{ title?: string }>()
</script>

<template>
  <div class="app-card">
    <div class="app-card-hd">
      <slot name="header">
        <h2 class="app-card-hd__title" v-if="title">{{ title }}</h2>
        <div class="app-card-hd-aside">
          <slot name="header-aside"></slot>
        </div>
      </slot>
    </div>
    <div class="app-card-bd">
      <slot></slot>
    </div>
  </div>
</template>

<style lang="scss">
.app-card {
  // background: #fff;
  // box-shadow: 0 1px 6px 0 rgb(228 232 235 / 20%);
  // border-radius: 6px;
  // padding: 20px;
}
.app-card + .app-card {
  margin-top: 20px;
}
.app-card-hd {
  display: flex;
}
.app-card-hd__title {
  flex: 1;
  margin-bottom: 20px;
  font-size: 20px;
  font-family: Source Han Sans CN;
  font-weight: bold;
  line-height: 1;
  color: #333333;
}
</style>
