<script>
    import { useTinyRouter } from 'svelte-tiny-router';
    import { t }               from '../../translations.svelte';

    let { goTag, task } = $props();
    let router = useTinyRouter();

    function onclick(){
        router.navigate(`/task/${task.id}/edit`);
    }

</script>

<button class="edit" {onclick}>{t('edit')}</button>
{@html task.description.rendered}
{#if task.tags}
{t('other_tags')}:<br/>
{#each task.tags as tag}
<button onclick={e => goTag(e,tag)}>{tag}</button>
{/each}
<hr />
{/if}
