Files
shared/packages/web-ui/src/lib/components/AppShell.svelte
T
Gabriel20xx 2f57554154
Lint / Lint (Node/Svelte) (push) Successful in 23s
Lint / Lint (Go) (push) Successful in 16s
Lint / Lint (Python) (push) Successful in 9s
Tests / Test (Node/Svelte) (push) Successful in 14s
Tests / Test (Go) (push) Successful in 17s
Tests / Test (Python) (push) Successful in 9s
Extend shared UI component customization
2026-08-04 16:53:36 +02:00

58 lines
1.2 KiB
Svelte

<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 = '',
headerActions,
navItems = [],
onLogout,
onNavigate,
onProfile,
onSettings,
showSettings = true,
theme = 'dark',
username = ''
}: {
brand?: string;
brandHref?: string;
children?: Snippet;
class?: string;
currentPath?: string;
headerActions?: Snippet;
navItems?: NavItem[];
onLogout?: () => void | Promise<void>;
onNavigate?: (item: NavItem) => void;
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}
actions={headerActions}
{navItems}
{onLogout}
{onNavigate}
{onProfile}
{onSettings}
{showSettings}
{username}
/>
<main class="sc-main">
{@render children?.()}
</main>
</div>