web-player: unify primitive link/button rendering, add onEscape action and self-contained AccountMenu

This commit is contained in:
2026-09-24 05:27:25 +02:00
parent 5cda7cb4c1
commit 8cb9386447
12 changed files with 103 additions and 128 deletions
@@ -21,15 +21,17 @@
);
</script>
{#snippet content()}
<!-- svelte-ignore a11y_no_static_element_interactions -->
<svelte:element
this={href ? 'a' : 'button'}
{href}
type={href ? undefined : 'button'}
disabled={href ? undefined : disabled}
onclick={href ? undefined : onclick}
class={classes}
>
{@render children()}
{#if count !== undefined}
<span class="tabular-nums {selected ? 'opacity-55' : 'text-fg-2'}">{count}</span>
{/if}
{/snippet}
{#if href}
<a {href} class={classes}>{@render content()}</a>
{:else}
<button type="button" {onclick} {disabled} class={classes}>{@render content()}</button>
{/if}
</svelte:element>