feat: add title to loop button

This commit is contained in:
dusk 2023-04-30 06:18:53 +03:00
parent ccb7ce70e7
commit 1dfc0dc01e
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA

View File

@ -30,9 +30,21 @@
} }
} }
function loopKindToString(kind: LoopKind) {
switch (kind) {
case LoopKind.Off:
return 'repeat off';
case LoopKind.Once:
return 'repeat playlist';
case LoopKind.Always:
return 'repeat song';
}
}
$: icon = getIcon($loop); $: icon = getIcon($loop);
$: title = loopKindToString($loop);
</script> </script>
<button on:click={changeLoop}> <button {title} on:click={changeLoop}>
<svelte:component this={icon} class="w-7 h-7" /> <svelte:component this={icon} class="w-7 h-7" />
</button> </button>