J.A.R.V.I.S-rust/frontend/src/components/Header.svelte

55 lines
1.4 KiB
Svelte
Raw Normal View History

<script lang="ts">
2026-01-04 22:50:34 +05:00
import { onMount } from "svelte"
2026-01-04 09:00:51 +05:00
import { invoke } from "@tauri-apps/api/core"
2026-01-04 22:50:34 +05:00
import { isActive } from "@roxi/routify"
import { Dashboard, Gear } from "radix-icons-svelte"
2026-01-04 22:50:34 +05:00
let appVersion = ""
2026-01-04 22:50:34 +05:00
onMount(async () => {
try {
appVersion = await invoke<string>("get_app_version")
} catch (err) {
console.error("failed to get app version:", err)
}
})
</script>
2026-01-04 22:50:34 +05:00
<header id="header">
<div class="logo">
2026-01-04 22:50:34 +05:00
<a href="/" title="Проект канала Хауди Хо!">
<img src="/media/header-logo.png" alt="Jarvis Logo" />
</a>
<div>
<h1><a href="/">JARVIS</a></h1>
2026-01-04 22:50:34 +05:00
<h2>
v{appVersion}
<small class="beta-badge">BETA</small>
</h2>
</div>
</div>
2026-01-04 22:50:34 +05:00
<nav class="top-menu">
<ul>
2026-01-04 22:50:34 +05:00
<li>
<a href="/commands" class:active={$isActive("/commands")}>
<Dashboard /> Команды
</a>
</li>
<li>
<a href="/settings" class:active={$isActive("/settings")}>
<Gear /> Настройки
</a>
</li>
</ul>
</nav>
2026-01-04 22:50:34 +05:00
</header>
<style lang="scss">
.beta-badge {
color: #8AC832;
opacity: 0.9;
font-size: 13px;
}
</style>