<template>
  <view class="section-wrapper">
    <view class="section-header">
      <view class="section-title">{{ title }}</view>
      <view class="section-header-right">
        <slot name="header-right"></slot>
      </view>
    </view>
    <view class="section-body">
      <slot></slot>
    </view>
  </view>
</template>

<script>
export default {
  name: 'SectionTitle',
  props: {
    title: {
      type: String,
      default: ''
    }
  }
}
</script>

<style lang="scss" scoped>
.section-wrapper {
    background: rgba(45, 42, 85, 0.6);
    border-radius: 20rpx;
    padding: 32rpx;
    margin-bottom: 24rpx;
    border: 1rpx solid rgba(167, 139, 250, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24rpx;
}

.section-title {
    font-size: 30rpx;
    font-weight: 600;
    color: #A78BFA;
    position: relative;
    padding-left: 16rpx;

    &::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 4rpx;
        height: 28rpx;
        background: #A78BFA;
        border-radius: 2rpx;
    }
}

.section-header-right {
    font-size: 24rpx;
    color: rgba(255, 255, 255, 0.5);
}
</style>