<script setup lang="ts">
import type { SiteDocument } from '../../server/utils/site-schema'

defineProps<{ site: SiteDocument }>()
</script>

<template>
  <div class="public-page-shell">
    <SiteHeader :logo="site.brand.logo" :brand-name="site.brand.name" :english-name="site.brand.englishName" :nav-font-size="site.brand.navFontSize" />
    <main id="main-content" class="public-page-main"><slot /></main>
    <footer id="contact" class="site-footer">
      <div class="footer-brand"><BrandLogo :src="site.brand.logo" :name="site.brand.name" :english-name="site.brand.englishName" /><p>{{ site.brand.subSlogan }}</p></div>
      <div class="footer-contact">
        <p><a v-if="!/[待演示]/.test(site.contact.phone)" :href="`tel:${site.contact.phone.replace(/\s/g, '')}`">{{ site.contact.phone }}</a><span v-else>{{ site.contact.phone }}</span></p>
        <p><a v-if="site.contact.email.includes('@') && !site.contact.email.includes('演示')" :href="`mailto:${site.contact.email}`">{{ site.contact.email }}</a><span v-else>{{ site.contact.email }}</span></p>
        <p>{{ site.contact.address }}</p>
      </div>
      <div class="footer-meta">
        <span>{{ site.brand.copyright }}</span>
        <span><NuxtLink to="/privacy">隐私政策</NuxtLink> · <NuxtLink to="/terms">服务条款</NuxtLink> · <FilingLinks :icp="site.brand.icp" :police-record="site.brand.policeRecord" /></span>
      </div>
    </footer>
  </div>
</template>
