<script lang="ts">
	import { Button } from '$lib/components/ui/button/index.js';
	import { Label } from '$lib/components/ui/label/index.js';
	import { Input } from '$lib/components/ui/input/index.js';
	import * as Card from '$lib/components/ui/card/index.js';

	import StatusHealth from '$lib/assets/status-health.svelte';
	import * as adb from '$lib/core/adb/adb';
	import Checkbox from '$lib/components/ui/checkbox/checkbox.svelte';
	import { TerminalComponent } from '$lib/components/ui/terminal';
	import { onMount } from 'svelte';
	import { goto } from '$app/navigation';

	import { auth as authStore } from '$lib/core/stores/auth';
	import { auth } from '$lib/core/client/firebase';
	import { get } from 'svelte/store';

	onMount(() => {
		let existed_account = get(authStore);
		let current_user_logged = auth.currentUser;
		console.log(
			`has acc ${JSON.stringify(existed_account)}, from session: ${JSON.stringify(current_user_logged)}`
		);

		if (existed_account || current_user_logged) {
			goto('/entry');
		}
	});
</script>

<!--
<button
	class="bg-white px-4 py-2 border flex gap-2 border-slate-200 rounded-lg text-slate-700 hover:border-slate-400 hover:text-slate-900 hover:shadow transition duration-150"
	onclick={logout}
>
	<span>Logout</span>
</button> -->
