<script setup lang="ts">
import { useAuthSession } from '../../composables/useAuthSession'

import GuestHomeSection from '../../components/home/GuestHomeSection.vue'
import LoggedInHomeSection from '../../components/home/LoggedInHomeSection.vue'

const { loggedIn, user } = useAuthSession()
const { allowRegister, siteName } = useGlobalConfig()

usePageTitle('首页')
</script>

<template>
  <div class="mx-auto max-w-6xl pb-4">
    <LoggedInHomeSection v-if="loggedIn && user" :user="user" />
    <GuestHomeSection v-else :site-name="siteName" :allow-register="allowRegister" />
  </div>
</template>
