<template>
  <div class="container">
    <h1>Error {{ error.statusCode || '' }}</h1>
    <span>{{ error.message }}</span>
    <NuxtLink to="/">Home page</NuxtLink>
  </div>
</template>

<script>
export default {
  layout: `${process.env.CUSTOMER}Admin`,
  props: {
    error: {
      type: Object,
      default: null,
    },
  },
  computed: {
    errorMessage() {
      if (this.error && this.error?.message) return this.error?.message
      return 'An error occurred'
    },
  },
  head() {
    return {
      title: this.errorMessage,
    }
  },
}
</script>
