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

const props = defineProps({	
  title: String,
  desc: String
})

if (props.title) {
  uni.setNavigationBarTitle({
    title: props.title,
  })
}
</script>

<template>
  <CommonRoot>
    <view class="nana-demo-page">
      <view class="header">
        <text class="title">{{ title }}</text>
        <text v-if="desc" class="desc">{{ desc }}</text>
      </view>
      <slot />
    </view>
  </CommonRoot>
</template>

<style>
.nana-demo-page {
  display: flex;
  flex-direction: column;
  background-color: #efefef;
  /* #ifdef H5 */
  min-height: calc(100vh - 44px - env(safe-area-inset-top));
  /* #endif */
  /* #ifndef H5 */
  min-height: calc(100vh - 44px);
  /* #endif */
}
.nana-demo-page > .header {
  display: flex;
  flex-direction: column;
  margin: 40rpx 40rpx;
  flex-shrink: 0;
}
.nana-demo-page > .header .title {
  font-size: 45rpx;
  font-weight: bold;
  color: #0079db;
}
.nana-demo-page > .header .desc {
  font-size: 28rpx;
  color: #888;
  margin-top: 15rpx;
}
</style>