mirror of
https://github.com/elk-zone/elk.git
synced 2024-12-20 10:55:18 +03:00
37 lines
1.1 KiB
Vue
37 lines
1.1 KiB
Vue
<script setup lang="ts">
|
|
const { t } = useI18n()
|
|
|
|
const tabs = $computed(() => [
|
|
{
|
|
to: isHydrated.value ? `/${currentServer.value}/explore` : '/explore',
|
|
display: isHydrated.value ? t('tab.posts') : '',
|
|
},
|
|
{
|
|
to: isHydrated.value ? `/${currentServer.value}/explore/tags` : '/explore/tags',
|
|
display: isHydrated.value ? t('tab.hashtags') : '',
|
|
},
|
|
{
|
|
to: isHydrated.value ? `/${currentServer.value}/explore/links` : '/explore/links',
|
|
display: isHydrated.value ? t('tab.news') : '',
|
|
},
|
|
// This section can only be accessed after logging in
|
|
{
|
|
to: isHydrated.value ? `/${currentServer.value}/explore/users` : '/explore/users',
|
|
display: isHydrated.value ? t('tab.for_you') : '',
|
|
disabled: !isHydrated.value || !currentUser.value,
|
|
},
|
|
] as const)
|
|
</script>
|
|
|
|
<template>
|
|
<MainContent no-overflow-hidden>
|
|
<template #title>
|
|
<SearchWidget ref="search" class="m-1" />
|
|
</template>
|
|
|
|
<template #header>
|
|
<CommonRouteTabs replace :options="tabs" />
|
|
</template>
|
|
<NuxtPage v-if="isHydrated" />
|
|
</MainContent>
|
|
</template>
|