2024-04-26 13:33:17 +02:00
|
|
|
<script lang="ts">
|
2025-02-02 11:17:22 +01:00
|
|
|
import * as Card from '$lib/components/ui/card';
|
|
|
|
import { Button } from '$lib/components/ui/button';
|
|
|
|
import Shortcut from '$lib/components/Shortcut.svelte';
|
|
|
|
import { canChangeStart } from './RoutingControls';
|
2025-06-21 21:07:36 +02:00
|
|
|
import { CirclePlay, Trash2 } from '@lucide/svelte';
|
2024-04-26 13:33:17 +02:00
|
|
|
|
2025-06-21 21:07:36 +02:00
|
|
|
import { i18n } from '$lib/i18n.svelte';
|
2024-04-26 13:33:17 +02:00
|
|
|
|
2025-02-02 11:17:22 +01:00
|
|
|
export let element: HTMLElement;
|
2024-04-26 13:33:17 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div bind:this={element} class="hidden">
|
2025-02-02 11:17:22 +01:00
|
|
|
<Card.Root class="border-none shadow-md text-base">
|
|
|
|
<Card.Content class="flex flex-col p-1">
|
|
|
|
{#if $canChangeStart}
|
|
|
|
<Button
|
|
|
|
class="w-full px-2 py-1 h-6 justify-start"
|
|
|
|
variant="ghost"
|
2025-06-21 21:07:36 +02:00
|
|
|
onclick={() => element.dispatchEvent(new CustomEvent('change-start'))}
|
2025-02-02 11:17:22 +01:00
|
|
|
>
|
|
|
|
<CirclePlay size="16" class="mr-1" />
|
2025-06-21 21:07:36 +02:00
|
|
|
{i18n._('toolbar.routing.start_loop_here')}
|
2025-02-02 11:17:22 +01:00
|
|
|
</Button>
|
|
|
|
{/if}
|
|
|
|
<Button
|
|
|
|
class="w-full px-2 py-1 h-6 justify-start"
|
|
|
|
variant="ghost"
|
2025-06-21 21:07:36 +02:00
|
|
|
onclick={() => element.dispatchEvent(new CustomEvent('delete'))}
|
2025-02-02 11:17:22 +01:00
|
|
|
>
|
|
|
|
<Trash2 size="16" class="mr-1" />
|
2025-06-21 21:07:36 +02:00
|
|
|
{i18n._('menu.delete')}
|
2025-02-02 11:17:22 +01:00
|
|
|
<Shortcut shift={true} click={true} />
|
|
|
|
</Button>
|
|
|
|
</Card.Content>
|
|
|
|
</Card.Root>
|
2024-04-26 13:33:17 +02:00
|
|
|
</div>
|