{#each modes as _mode}
{@const counter = counters[_mode.value] ?? 0}
0 ? counter : null}
on:click={() => {
mode = _mode.value
tag = undefined
localStorage.setItem('todos_last_mode', mode)
localStorage.removeItem('todos_last_tag')
}}
/>
{/each}
{
if (event.detail) {
tag = undefined
currentDate = event.detail
mode = 'date'
localStorage.setItem('todos_last_mode', mode)
localStorage.removeItem('todos_last_tag')
}
}}
>
{#if tags.length > 0}
{#each tags as _tag}
{@const color = getPlatformColorDef(_tag.color ?? 0, $themeStore.dark)}
{
mode = 'tag'
tag = _tag._id
localStorage.setItem('todos_last_mode', mode)
localStorage.setItem('todos_last_tag', tag)
}}
/>
{/each}
{#if !isOpen}
{@const visibleTag = tags.find((t) => t._id === tag)}
{#if visibleTag}
{@const color = getPlatformColorDef(visibleTag.color ?? 0, $themeStore.dark)}
{/if}
{/if}
{/if}