<template>
	<w-app :class="appClass" class="shade-1--bg">
		<Maintenance
			v-if="hasMaintenance"
		/>
		<template v-else>
			<Toolbar ref="toolbar" />
			<Nuxt />
		</template>
	</w-app>
</template>

<script lang="ts">
import Vue from 'vue';

export default Vue.extend({

	computed: {
		appClass(): any {
			return this.$store.state.isDark ? 'w-app--dark' : 'w-app--light';
		},
		hasMaintenance(): boolean {
			return this.$store.state.config.maintenance && this.$store.state.profile?.role != 'admin';
		}
	}
});
</script>