<template>
  <v-app dark>
    <h1 v-if="error.statusCode !== 404">
      {{ otherError }}
    </h1>
  </v-app>
</template>

<script lang="ts">
import { defineComponent, useContext} from '@nuxtjs/composition-api'

export default defineComponent({
  props: {
    error: {
      type: Object,
      default: null
    }
  },
  setup (props) {
    const {$config} = useContext()
    const baseLegacyUrl:string = $config.baseURL_adminLegacy
    if(process.client && props.error.statusCode === 404)
      window.location.href= `${baseLegacyUrl}/dashboard`

    return {
      otherError: 'Une erreur est parvenue'
    }
  }
})
</script>

<style scoped>
  h1 {
    font-size: 20px;
  }
</style>
