2026-02-17 14:30:02 +07:00
|
|
|
<!-- navbar select menus -->
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import favicon from '$lib/assets/favicon.svg';
|
|
|
|
|
import AppAccountSelect from '$lib/components/app-account-select.svelte';
|
|
|
|
|
import AppSidebar from '$lib/components/app-sidebar.svelte';
|
|
|
|
|
import * as Sidebar from '$lib/components/ui/sidebar/index';
|
|
|
|
|
import '../layout.css';
|
|
|
|
|
import ErrorLayout from '$lib/components/error-layout.svelte';
|
|
|
|
|
import { sidebarStore } from '$lib/core/stores/sidebar';
|
2026-02-26 12:49:08 +07:00
|
|
|
import { onMount } from 'svelte';
|
|
|
|
|
import { auth } from '$lib/core/stores/auth';
|
|
|
|
|
import { get } from 'svelte/store';
|
|
|
|
|
import { connectToWebsocket } from '$lib/core/stores/websocketStore';
|
2026-02-17 14:30:02 +07:00
|
|
|
|
|
|
|
|
let { children } = $props();
|
2026-02-26 12:49:08 +07:00
|
|
|
|
|
|
|
|
onMount(() => {
|
|
|
|
|
let currentUser = get(auth);
|
|
|
|
|
console.log(`on mount layout current user: ${JSON.stringify(currentUser)}`);
|
|
|
|
|
if (currentUser) {
|
|
|
|
|
connectToWebsocket();
|
|
|
|
|
}
|
|
|
|
|
});
|
2026-02-17 14:30:02 +07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<svelte:head>
|
|
|
|
|
<link rel="icon" href={favicon} />
|
|
|
|
|
<link href="https://fonts.googleapis.com/css2?family=Roboto+Flex" rel="stylesheet" />
|
|
|
|
|
<title>Taobin Management Tools</title>
|
|
|
|
|
</svelte:head>
|
|
|
|
|
|
|
|
|
|
<Sidebar.Provider
|
|
|
|
|
onOpenChange={(open) => {
|
|
|
|
|
sidebarStore.set(open);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<AppSidebar />
|
|
|
|
|
<main class="h-screen w-screen overflow-hidden">
|
|
|
|
|
<Sidebar.Trigger />
|
|
|
|
|
{@render children()}
|
|
|
|
|
</main>
|
|
|
|
|
</Sidebar.Provider>
|