Made small architectural change for TrackRow

This commit is contained in:
lucast committed 2026-02-24 18:26:19 +01:00
1 parent 1060eeba58
commit 6c10a53a75
1 file changed
+6 -3
+6 -3
View File
@@ -8,6 +8,7 @@ interface TrackRowProps {
} }
const { track, index, extendedInfo } = defineProps<TrackRowProps>() const { track, index, extendedInfo } = defineProps<TrackRowProps>()
const emit = defineEmits<{ (e: "playAlbumAtIndex"): void }>()
const hovering = ref(false) const hovering = ref(false)
@@ -38,8 +39,6 @@ const dropdownMenuItems: DropdownMenuItem[] = [
const durationFormatted = computed(() => const durationFormatted = computed(() =>
new Date(track.durationInSeconds * 1000).toISOString().slice(14, 19), new Date(track.durationInSeconds * 1000).toISOString().slice(14, 19),
) )
const play = () => {}
</script> </script>
<template> <template>
@@ -50,7 +49,11 @@ const play = () => {}
@mouseleave="hovering = false" @mouseleave="hovering = false"
> >
<div class="index"> <div class="index">
<Icon name="lucide:play" @click="play" v-if="hovering" /> <Icon
name="lucide:play"
@click="emit('playAlbumAtIndex')"
v-if="hovering"
/>
<p v-else>{{ index + 1 }}</p> <p v-else>{{ index + 1 }}</p>
</div> </div>