-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.vue
39 lines (32 loc) · 924 Bytes
/
error.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<script setup lang="ts">
import type { NuxtError } from "#app"
const themeStore = useThemeStore()
useHead({
title: "404 Gak Ketemu",
bodyAttrs: {
class: computed(() => [
"bg-surface-100/80 dark:bg-surface-900 dark:text-gray-300",
themeStore.theme ?? "",
]),
},
})
defineProps({
error: Object as () => NuxtError,
})
const handleError = () => clearError({ redirect: "/" })
</script>
<template>
<NuxtLayout name="default">
<section class="flex flex-col items-center">
<template v-if="error?.statusCode === 404">
<h1>Halamannya gak ketemu!</h1>
<p>Maaf ya. Balik lagi aja ke beranda gih</p>
</template>
<template v-else>
<h1>Ada yang salah!</h1>
<p>Ga tau deh kenapa. Laporkan ke admin atau kembali ke beranda</p>
</template>
<CTA label="kembali ke beranda" @click="handleError" />
</section>
</NuxtLayout>
</template>