add hide button

This commit is contained in:
centdix
2025-06-02 17:06:40 +02:00
parent af37a9332e
commit 6f5806d1e1
@@ -1,7 +1,8 @@
<script lang="ts">
import { userStore, copilotInfo } from '$lib/stores'
import { userStore, copilotInfo, globalChatOpen } from '$lib/stores'
import AiChat from '../copilot/chat/AIChat.svelte'
import { base } from '$lib/base'
import HideButton from '../apps/editor/settingsPanel/HideButton.svelte'
const isAdmin = $derived($userStore?.is_admin || $userStore?.is_super_admin)
const hasCopilot = $derived($copilotInfo.enabled)
@@ -22,5 +23,24 @@
</script>
<div class="relative flex flex-col h-full bg-surface z-20">
<AiChat navigatorMode disabled={!hasCopilot} {disabledMessage} {suggestions} />
<AiChat
navigatorMode
disabled={!hasCopilot}
{disabledMessage}
{suggestions}
headerLeft={aiChatHeaderLeft}
/>
</div>
{#snippet aiChatHeaderLeft()}
<HideButton
hidden={false}
direction="right"
panelName="AI"
shortcut="L"
size="md"
on:click={() => {
globalChatOpen.set(!$globalChatOpen)
}}
/>
{/snippet}