yeah
This commit is contained in:
@@ -12,25 +12,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { usePlatineStore } from '~/store/platine'
|
||||
import type { Box, Track } from '~/../types/types'
|
||||
|
||||
const platineStore = usePlatineStore()
|
||||
const props = defineProps<{ objectToPlay: Box | Track }>()
|
||||
|
||||
const isCurrentTrack = computed(() => {
|
||||
if (!('activeSide' in props.objectToPlay)) {
|
||||
return platineStore.currentTrack?.id === props.objectToPlay.id
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
const isPlaying = computed(() => {
|
||||
return platineStore.isPlaying && isCurrentTrack.value
|
||||
})
|
||||
|
||||
const isLoading = computed(() => {
|
||||
return platineStore.isLoadingTrack && isCurrentTrack.value
|
||||
const props = withDefaults(defineProps<{
|
||||
isLoading?: boolean;
|
||||
isPlaying?: boolean;
|
||||
}>(), {
|
||||
isLoading: false,
|
||||
isPlaying: false
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user