kunkun/packages/ui/src/components/main/GlobalCommandPaletteFooter.svelte
Huakun Shen 4a05c5a475
[Feature] Implement UI template worker command (#20)
* feat: add ui worker command loading code (not working yet)

* feat: add unocss

* feat: add-dev-extension page

* feat: implemented list view template

* feat: implement list view detail view width, add demo extension for dev

* fix: resize listview, add metadata component

* fix: metadata tag component  background color

* feat: implement boolean (checkbox), date fields for form template

* feat: support default, optional, placeholder for form fields

* feat: implemented form view Select Field

* feat: markdown view

* feat: fixed a markdown schema type error

* fix: markdown styling

* feat: implement action panel for UI worker template list view

* format: format all

* chore: bump desktop version

* fix: fix search term bind in list view
2024-11-08 15:12:20 -05:00

43 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-2">
<Avatar.Image src="/favicon.png" alt="Kunkun Logo" class="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>