2023-01-14 23:58:52 +03:00
|
|
|
<script setup>
|
|
|
|
definePageMeta({
|
|
|
|
middleware: () => {
|
2023-01-29 17:18:27 +03:00
|
|
|
if (!useAppConfig().pwaEnabled)
|
2023-01-14 23:58:52 +03:00
|
|
|
return navigateTo('/')
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
useWebShareTarget()
|
|
|
|
|
2023-02-16 12:23:26 +03:00
|
|
|
const pwaIsInstalled = process.client && !!useNuxtApp().$pwa?.isInstalled
|
2023-01-14 23:58:52 +03:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<MainContent>
|
|
|
|
<template #title>
|
|
|
|
<NuxtLink to="/share-target" flex items-center gap-2>
|
|
|
|
<div i-ri:share-line />
|
2023-09-06 15:51:01 +03:00
|
|
|
<span>{{ $t('share_target.title') }}</span>
|
2023-01-14 23:58:52 +03:00
|
|
|
</NuxtLink>
|
|
|
|
</template>
|
|
|
|
<slot>
|
|
|
|
<div flex="~ col" px5 py2 gap-y-4>
|
|
|
|
<div
|
|
|
|
v-if="!pwaIsInstalled || !currentUser"
|
|
|
|
role="alert"
|
|
|
|
gap-1
|
|
|
|
p-2
|
|
|
|
text-red-600 dark:text-red-400
|
|
|
|
border="~ base rounded red-600 dark:red-400"
|
|
|
|
>
|
2023-09-06 15:51:01 +03:00
|
|
|
{{ $t('share_target.hint') }}
|
2023-01-14 23:58:52 +03:00
|
|
|
</div>
|
2023-09-06 15:51:01 +03:00
|
|
|
<div>{{ $t('share_target.description') }}</div>
|
2023-01-14 23:58:52 +03:00
|
|
|
</div>
|
|
|
|
</slot>
|
|
|
|
</MainContent>
|
|
|
|
</template>
|