J.A.R.V.I.S-rust/frontend/src/routes/index.svelte

47 lines
1.3 KiB
Svelte
Raw Normal View History

<script lang="ts">
2026-01-04 22:50:34 +05:00
import { onMount, onDestroy } from "svelte"
import { Notification, Space } from "@svelteuidev/core"
import { InfoCircled } from "radix-icons-svelte"
import SearchBar from "@/components/elements/SearchBar.svelte"
import ArcReactor from "@/components/elements/ArcReactor.svelte"
import HDivider from "@/components/elements/HDivider.svelte"
import Stats from "@/components/elements/Stats.svelte"
import Footer from "@/components/Footer.svelte"
2026-01-04 22:50:34 +05:00
import { isListening } from "@/stores"
2026-01-04 22:50:34 +05:00
let listening = false
isListening.subscribe(value => {
listening = value
})
2026-01-04 22:50:34 +05:00
onMount(() => {
document.body.classList.add("assist-page")
})
2026-01-04 22:50:34 +05:00
onDestroy(() => {
document.body.classList.remove("assist-page")
})
</script>
<HDivider />
2026-01-04 22:50:34 +05:00
{#if !listening}
<Notification
title="Внимание!"
icon={InfoCircled}
color="cyan"
withCloseButton={false}
>
В данный момент ассистент не прослушивает команды.<br />
Пожалуйста, <a href="/settings">перейдите в настройки</a> и введите ключ Picovoice.
</Notification>
{:else}
2026-01-04 22:50:34 +05:00
<ArcReactor />
{/if}
2026-01-04 22:50:34 +05:00
<HDivider noMargin />
<Stats />
<Footer />