<script lang="ts">
	import '$lib/styles/main.scss';
	import Header from '$lib/components/layout/Header.svelte';
	import Footer from '$lib/components/layout/Footer.svelte';
	import DropPasteHandler from '$lib/components/DropPasteHandler.svelte';
	import AddModal from '$lib/components/AddModal.svelte';
	import { onMount } from 'svelte';
	import { goto } from '$app/navigation';
	import { vaultInfo, vaultOptions } from '$lib/util/info';
	import LoginModal from '$lib/components/LoginModal.svelte';
	import { currentUser } from '$lib/api';

	onMount(() => {
		if ($vaultOptions && !$vaultOptions.blob_mode) {
			goto('/setup');
		}
	});
</script>

<Header />
<main>
	<slot />
</main>
<Footer />

<AddModal />
{#if $vaultInfo && !$vaultInfo.public && !$currentUser}
	<LoginModal />
{/if}
<DropPasteHandler />
