Skip to content

Commit eade04b

Browse files
authored
error page
1 parent e05c7e7 commit eade04b

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

resources/js/pages/Error.vue

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<script setup>
2+
import { computed } from 'vue';
3+
import { ArrowLeft } from 'lucide-vue-next';
4+
5+
const props = defineProps({
6+
homeRoute: String,
7+
status: Number
8+
});
9+
10+
const title = computed(() => {
11+
return {
12+
503: '503: Service Unavailable',
13+
500: '500: Server Error',
14+
404: '404: Page Not Found',
15+
403: '403: Forbidden',
16+
}[props.status];
17+
});
18+
19+
const description = computed(() => {
20+
return {
21+
503: 'Sorry, we are doing some maintenance. Please check back soon.',
22+
500: 'Whoops, something went wrong on our servers.',
23+
404: 'Sorry, the page you are looking for could not be found.',
24+
403: 'Sorry, you are forbidden from accessing this page.',
25+
}[props.status];
26+
});
27+
</script>
28+
29+
<template>
30+
<InertiaHead title="Error" />
31+
<Container fluid>
32+
<main>
33+
<div class="h-screen flex items-center justify-center">
34+
<Card class="p-4 py-6 sm:p-12">
35+
<template #content>
36+
<div class="text-center">
37+
<section>
38+
<h2 class="mb-8 font-extrabold text-5xl md:text-8xl">
39+
{{ title }}
40+
</h2>
41+
<p class="mb-8 text-2xl font-semibold md:text-3xl text-muted-color">
42+
{{ description }}
43+
</p>
44+
<InertiaLink :href="props.homeRoute">
45+
<Button
46+
label="Back to homepage"
47+
raised
48+
>
49+
<template #icon>
50+
<ArrowLeft />
51+
</template>
52+
</Button>
53+
</InertiaLink>
54+
</section>
55+
</div>
56+
</template>
57+
</Card>
58+
</div>
59+
</main>
60+
</Container>
61+
</template>

0 commit comments

Comments
 (0)