feat: add subactions
This commit is contained in:
1 parent
2bf28fcdb7
commit
69be40b4b7
6 files changed
+298
-132
No files matched your search
@@ -0,0 +1,32 @@
|
||||
<script lang="ts">
|
||||
import { t } from '$lib/translations'
|
||||
import { Modal, Spinner } from 'mono-svelte'
|
||||
import Commands from './Commands.svelte'
|
||||
|
||||
export let open: boolean = false
|
||||
|
||||
function handleKeydown(event: KeyboardEvent) {
|
||||
if (
|
||||
(event.ctrlKey && event.key === 'p') ||
|
||||
(event.key == '/' && document.activeElement == document.body)
|
||||
) {
|
||||
event.preventDefault()
|
||||
open = !open
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:window on:keydown={handleKeydown} />
|
||||
|
||||
{#if open}
|
||||
<Modal title={$t('nav.commands.prompt')} bind:open>
|
||||
{#await import('./Commands.svelte')}
|
||||
<div class="h-96 flex flex-col gap-2 items-center justify-center">
|
||||
<Spinner width={32} />
|
||||
<span class="font-medium text-lg">Downloading actions...</span>
|
||||
</div>
|
||||
{:then { default: Commands }}
|
||||
<Commands bind:open />
|
||||
{/await}
|
||||
</Modal>
|
||||
{/if}
|
||||
Reference in new issue
Block a user