netdiag-app/src/lib/components/AppHeader.svelte
Eduard Wisch fca59545cc Einstellungen per Zahnrad erreichbar, verwirrenden Sync-Punkt entfernt [apk]
- AppHeader: farbiger Sync-Ampel-Punkt raus (war nicht selbsterklaerend),
  stattdessen Zahnrad-Icon -> Einstellungen, von jeder Seite erreichbar
- Einstellungen neu gegliedert: App (Version + Update-Button) zuerst,
  dann Synchronisierung (Status in Klartext + manueller Sync), Konto, Abmelden

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 16:30:29 +02:00

36 lines
1 KiB
Svelte

<script lang="ts">
import { page } from '$app/stores';
import { ChevronLeft, Settings } from 'lucide-svelte';
let {
title,
back = false,
subtitle = '',
}: { title: string; back?: boolean; subtitle?: string } = $props();
// Zahnrad auf der Einstellungs-Seite selbst ausblenden
const onSettings = $derived($page.url.pathname.startsWith('/einstellungen'));
</script>
<header class="flex items-center gap-2 border-b border-zinc-800 bg-zinc-900 px-3 pb-3 safe-top">
{#if back}
<button class="rounded p-1 active:bg-zinc-800" onclick={() => history.back()} aria-label="Zurück">
<ChevronLeft size={24} />
</button>
{/if}
<div class="min-w-0 flex-1">
<h1 class="truncate text-base font-semibold">{title}</h1>
{#if subtitle}
<p class="truncate text-xs text-zinc-400">{subtitle}</p>
{/if}
</div>
{#if !onSettings}
<a
class="rounded p-1.5 text-zinc-300 active:bg-zinc-800"
href="/einstellungen/"
aria-label="Einstellungen"
>
<Settings size={22} />
</a>
{/if}
</header>