<template>
  <view>
    <view v-if="useCustomNav" class="custom-nav">
      <view class="nav-title">{{ title }}</view>
    </view>
    <view class="text-area">
      <text class="title">{{ title }}</text>
    </view>
  </view>
</template>

<script setup lang="ts">
import { defineProps } from 'vue'

const props = defineProps({
  title: { type: String, required: true },
  useCustomNav: { type: Boolean, default: false }
})

const title = props.title
const useCustomNav = props.useCustomNav
</script>

<style scoped>
.text-area {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 40rpx;
}

.title {
  font-size: 36rpx;
  color: #8f8f94;
  font-weight: 400;
}

.custom-nav {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 88rpx;
  padding-top: constant(safe-area-inset-top);
  padding-top: env(safe-area-inset-top);
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-bottom: 1rpx solid #eee;
}

.nav-title {
  font-size: 34rpx;
  font-weight: bold;
  color: #333;
}
</style>
