_.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!-- The Catch-All Page -->
  2. <!-- Reserved for Critical Errors and 404 ONLY -->
  3. <template>
  4. <div
  5. class="flex flex-col items-center justify-center"
  6. :class="{ 'min-h-screen': statusCode !== 404 }"
  7. >
  8. <img
  9. :src="`/images/youre_lost.svg`"
  10. loading="lazy"
  11. class="inline-flex flex-col object-contain object-center mb-2 h-46 w-46"
  12. :alt="message"
  13. />
  14. <h1 class="mb-2 text-4xl heading">
  15. {{ statusCode }}
  16. </h1>
  17. <p class="mb-4 text-secondaryLight">{{ message }}</p>
  18. <p class="mt-4 space-x-2">
  19. <HoppButtonSecondary to="/" :icon="IconHome" filled label="Home" />
  20. <HoppButtonSecondary
  21. :icon="IconRefreshCW"
  22. label="Reload"
  23. filled
  24. @click="reloadApplication"
  25. />
  26. </p>
  27. </div>
  28. </template>
  29. <script setup lang="ts">
  30. import IconRefreshCW from '~icons/lucide/refresh-cw';
  31. import IconHome from '~icons/lucide/home';
  32. import { PropType, computed } from 'vue';
  33. export type ErrorPageData = {
  34. message: string;
  35. statusCode: number;
  36. };
  37. const props = defineProps({
  38. error: {
  39. type: Object as PropType<ErrorPageData | null>,
  40. default: null,
  41. },
  42. });
  43. const statusCode = computed(() => props.error?.statusCode ?? 404);
  44. const message = computed(
  45. () => props.error?.message ?? 'The page you are looking for does not exist.'
  46. );
  47. const reloadApplication = () => {
  48. window.location.reload();
  49. };
  50. </script>