<script setup lang="ts">
import DemoTitle from './DemoTitle.vue';

defineProps({	
  title: String,
  desc: String,
  flat: Boolean,
  smallTitle: Boolean,
})
</script>

<template>
  <view :class="['nana-demo-block',flat?'flat':'']">
    <view class="header">
      <DemoTitle v-if="title" :title="title" :desc="desc" :small="smallTitle" />
      <text class="sub-title" v-if="desc">{{ desc }}</text>
    </view>
    <slot />
  </view>
</template>

<style>
.nana-demo-block {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0 40rpx 40rpx 40rpx;
}
.nana-demo-block.flat {
  padding: 0;
  margin: 0;
  margin-bottom: 40rpx;
  background-color: transparent; 
}
.nana-demo-block.flat .header {
  margin: 0 40rpx 20rpx 40rpx;
}
.nana-demo-block .header {
  margin: 0 0 20rpx 0;
}
.nana-demo-block .sub-title {
  font-size: 28rpx;
  color: #888;
  margin-bottom: 20rpx;
}
</style>