Add error page

Add loading skeleton
This commit is contained in:
2025-10-11 22:30:25 +02:00
parent b3f0099b97
commit be463ae56a
2 changed files with 19 additions and 1 deletions

16
website/app/error.vue Normal file
View File

@@ -0,0 +1,16 @@
<template>
<div>
<h1>{{ error?.statusCode }}</h1>
<p>{{ error?.message }}</p>
<NuxtLink to="/">Go back home</NuxtLink>
<NuxtLink to="https://github.com/C9Glax/tranga-website/issues/new"><Icon name="i-lucide-github" />Report this issue</NuxtLink>
</div>
</template>
<script setup lang="ts">
import type { NuxtError } from '#app'
defineProps({
error: Object as () => NuxtError,
})
</script>

View File

@@ -1,6 +1,8 @@
<template> <template>
<UPageBody class="p-4 flex flex-row flex-wrap gap-6 mt-0"> <UPageBody class="p-4 flex flex-row flex-wrap gap-6 mt-0">
<USkeleton v-if="status !== 'success'" class="max-w-[600px] w-full h-[350px]" />
<MangaCard <MangaCard
v-else
v-for="(m, i) in manga" v-for="(m, i) in manga"
:manga="m" :manga="m"
:expanded="i === expanded" :expanded="i === expanded"
@@ -13,6 +15,6 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
const { data: manga } = await useApi('/v2/Manga', { key: FetchKeys.Manga.All }); const { data: manga, status } = await useApi('/v2/Manga', { key: FetchKeys.Manga.All, lazy: true });
const expanded = ref(-1); const expanded = ref(-1);
</script> </script>