<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;
  padding-left: 5px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 24px;
  border-left: 3px solid #aa1941;
}
</style>
