<template>
  <div>
    <Header />
    <main class="mt-16 px-4">
      <Nuxt />
    </main>
    <Footer />
  </div>
</template>

<script>
export default {
  middleware: ["redirect"],
  fetchOnServer: false,
  async fetch() {
    const { store } = this.$nuxt.context;
    if (!store.state.films.list.length) await store.dispatch("films/getList");
    if (!store.state.people.list.length) await store.dispatch("people/getList");
    if (!store.state.vehicles.list.length)
      await store.dispatch("vehicles/getList");
    if (!store.state.locations.list.length)
      await store.dispatch("locations/getList");
  }
};
</script>

<style>
html {
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  word-spacing: 1px;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

main {
  min-height: calc(100vh - 64px * 2);
}
</style>
