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