kunkun/packages/ui/src/components/main/GlobalCommandPaletteFooter.svelte
Huakun Shen 7865d18580
Feature: Settings (#23)
* feat: add pin screenshot builtin command

* feat: pin screenshot command nows zoom and scroll

* chore: upgrade @kksh/svelte5

* feat: add mdns built-in command

* feat: add sidebar for settings page

* fix: builtin command command listing problem with key id in "each" loop

* feat: add settings

* style: modify settings sidebar style

* feat: add sidebar to troubleshooter pages

* fix: some styling bug

* feat: add menu item highlight for sidebar

* feat: improve some keyboard interaction logic

* fix: improve troubleshooter flex box

* feat: add uuid for mdns

* fix mdns host removing caused by dead lock

* feat: settings page implemented, hotkey, hide on blur implemented

* style: update styles in settings

* feat: improve search bar dropdown menu items
2024-11-11 17:15:42 -05:00

47 lines
1.2 KiB
Svelte

<script lang="ts">
import Icon from "@iconify/svelte"
import { Action as ActionSchema } from "@kksh/api/models"
import { Avatar, Button } from "@kksh/svelte5"
import { cn } from "@kksh/ui/utils"
import Kbd from "../common/Kbd.svelte"
import ActionPanel from "./ActionPanel.svelte"
const {
class: className,
defaultAction,
actionPanel,
onDefaultActionSelected,
onActionSelected
}: {
class?: string
defaultAction?: string
actionPanel?: ActionSchema.ActionPanel
onDefaultActionSelected?: () => void
onActionSelected?: (value: string) => void
} = $props()
</script>
<flex
data-tauri-drag-region
class={cn("h-12 select-none items-center justify-between gap-4 border-t px-2", className)}
>
<Avatar.Root class="p-1.5">
<Avatar.Image
src="/favicon.png"
alt="Kunkun Logo"
class="h-full select-none invert dark:invert-0"
/>
</Avatar.Root>
<flex class="items-center gap-1">
{#if defaultAction}
<Button size="default" class="h-full" variant="ghost" onclick={onDefaultActionSelected}>
{defaultAction}
<Kbd><Icon icon="tdesign:enter" /></Kbd>
</Button>
{/if}
{#if actionPanel}
<ActionPanel {actionPanel} {onActionSelected} />
{/if}
</flex>
</flex>