Files
shared/packages/web-ui/src/lib/components/AppShell.svelte
T

57 lines
1.2 KiB
Svelte
Raw Normal View History

2026-08-04 15:17:15 +02:00
<script lang="ts">
import type { Snippet } from 'svelte';
import type { NavItem } from '../types';
import Header from './Header.svelte';
let {
brand = 'Application',
brandHref = '/',
children,
class: className = '',
currentPath = '',
2026-08-04 16:53:36 +02:00
headerActions,
2026-08-04 15:17:15 +02:00
navItems = [],
onLogout,
2026-08-04 16:53:36 +02:00
onNavigate,
2026-08-04 15:17:15 +02:00
onProfile,
onSettings,
showSettings = true,
theme = 'dark',
username = ''
}: {
brand?: string;
brandHref?: string;
children?: Snippet;
class?: string;
currentPath?: string;
2026-08-04 16:53:36 +02:00
headerActions?: Snippet;
2026-08-04 15:17:15 +02:00
navItems?: NavItem[];
onLogout?: () => void | Promise<void>;
2026-08-04 16:53:36 +02:00
onNavigate?: (item: NavItem) => void;
2026-08-04 15:17:15 +02:00
onProfile?: () => void;
onSettings?: () => void;
showSettings?: boolean;
theme?: 'dark' | 'light' | 'system';
username?: string;
} = $props();
</script>
<div class={`sc-root sc-app-shell ${className}`} data-theme={theme === 'system' ? undefined : theme}>
<Header
{brand}
{brandHref}
{currentPath}
2026-08-04 16:53:36 +02:00
actions={headerActions}
2026-08-04 15:17:15 +02:00
{navItems}
{onLogout}
2026-08-04 16:53:36 +02:00
{onNavigate}
2026-08-04 15:17:15 +02:00
{onProfile}
{onSettings}
{showSettings}
{username}
/>
<main class="sc-main">
{@render children?.()}
</main>
</div>