2024-09-07 08:38:18 +01:00
|
|
|
<script setup lang="ts">
|
2023-01-14 20:58:52 +00:00
|
|
|
definePageMeta({
|
|
|
|
middleware: () => {
|
2023-01-29 14:18:27 +00:00
|
|
|
if (!useAppConfig().pwaEnabled)
|
2023-01-14 20:58:52 +00:00
|
|
|
return navigateTo('/')
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
useWebShareTarget()
|
|
|
|
|
2024-02-24 16:46:14 +00:00
|
|
|
const pwaIsInstalled = import.meta.client && !!useNuxtApp().$pwa?.isInstalled
|
2023-01-14 20:58:52 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<MainContent>
|
|
|
|
<template #title>
|
|
|
|
<NuxtLink to="/share-target" flex items-center gap-2>
|
|
|
|
<div i-ri:share-line />
|
2023-09-06 13:51:01 +01:00
|
|
|
<span>{{ $t('share_target.title') }}</span>
|
2023-01-14 20:58:52 +00: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 13:51:01 +01:00
|
|
|
{{ $t('share_target.hint') }}
|
2023-01-14 20:58:52 +00:00
|
|
|
</div>
|
2023-09-06 13:51:01 +01:00
|
|
|
<div>{{ $t('share_target.description') }}</div>
|
2023-01-14 20:58:52 +00:00
|
|
|
</div>
|
|
|
|
</slot>
|
|
|
|
</MainContent>
|
|
|
|
</template>
|