Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

2.0 KB
Raw Blame
<template>
  <div class="error-container">
    <div class="error-content">
      <h1 class="error-code">{{ props.error?.statusCode }}</h1>
      <p class="error-message">{{ props.error?.statusMessage || 'Something went wrong' }}</p>
      <p>{{ error }}</p>
      <p class="error-description">An unexpected error has occurred. Please try refreshing the page or go back to the homepage.</p>
      <nuxt-link to="/" class="error-button">Return to Homepage</nuxt-link>
    </div>
    <div class="error-illustration">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
        <circle cx="250" cy="250" r="200" fill="#f3f4f6" />
        <path d="M250 100 L310 250 L190 250 Z" fill="#1d4ed8" />
        <circle cx="250" cy="250" r="50" fill="#93c5fd" />
      </svg>
    </div>
  </div>
</template>

<script setup lang="ts">
import type { NuxtError } from '#app';

const props = defineProps({
  error: {
    type: Object as () => NuxtError,
    default: () => ({
      statusCode: 500,
      statusMessage: 'Something went wrong',
    }),
  },
});
</script>

<style scoped lang="scss">
.error-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  text-align: center;
}

.error-content {
  max-width: 600px;
  margin-bottom: 20px;
}

.error-code {
  margin: 0;
  font-size: 96px;
  font-weight: bold;
  color: var(--text-body);
}

.error-message {
  margin: 10px 0;
  font-size: 24px;
  color: var(--text-primary);
}

.error-description {
  margin-bottom: 20px;
  font-size: 16px;
  color: var(--text-secondary);
}

.error-button {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  color: white;
  text-decoration: none;
  background-color: var(--primary);
  transition: background-color $transition-medium;
}

.error-button:hover {
  background-color: var(--primary-dark);
}

.error-illustration {
  margin-top: 20px;
}

.error-illustration svg {
  width: 100%;
  max-width: 300px;
  height: auto;
}
</style>