<script lang="ts" setup name="DetailPage">
defineProps({
  title: {
    type: String,
    required: true,
  },
})

const slots = useSlots()
</script>

<template>
  <div class="detail-main">
    <div class="header">
      <div class="title">
        {{ title }}
      </div>
      <div class="btns">
        <slot name="btns" />
      </div>
    </div>
    <div v-if="slots.default" class="content">
      <slot />
    </div>
  </div>
</template>

<style lang="scss" scoped>
.detail-main {
  .header {
    position: relative;
    background-color: #fff;
    height: 50px;
    border-radius: 8px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    display: flex;

    .title {
      font-weight: 700;
    }

    .btns {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
    }
  }

  .content {
    background-color: #fff;
    padding: 20px 20px 20px 10px;
    margin-top: 10px;
    border-radius: 8px;
  }
}
</style>
