<template>
  <div class="pwa" :class="darkMode ? 'dark-mode' : null">
    <div class="connection-status" v-if="$nuxt.isOffline">
      <p>{{ staticData.connection }}</p>
    </div>
    <pwa-about/>
    <pwa-header @darkModeStatus="changeTheme"/>
    <nuxt/>
    <page-load/>
  </div>
</template>


<script>
export default {
  data() {
    return {
      darkMode: false
    }
  },
  computed: {
    staticData() {
      return this.$store.state.staticData.pwa[this.$route.params.lang]
    }
  },
  methods: {
    changeTheme(val) {
      this.darkMode = val
    }
  },
  head() {
    return {
      htmlAttrs: {
        lang: this.$route.params.lang
      }
    }
  }
}
</script>
