repod/src/components/Player/Controls.vue

38 lines
729 B
Vue
Raw Normal View History

2023-08-27 22:20:34 +02:00
<template>
2023-08-28 21:25:12 +02:00
<div class="controls">
<PauseIcon v-if="!paused" class="pointer" :size="50" @click="pause" />
<PlayIcon v-if="paused" class="pointer" :size="50" @click="play" />
2023-08-28 21:18:14 +02:00
</div>
2023-08-27 22:20:34 +02:00
</template>
<script lang="ts">
import { mapActions, mapState } from 'pinia'
2024-03-16 18:35:31 +01:00
import PauseIcon from 'vue-material-design-icons/Pause.vue'
import PlayIcon from 'vue-material-design-icons/Play.vue'
import { usePlayer } from '../../store/player.ts'
2023-08-27 22:20:34 +02:00
export default {
name: 'Controls',
components: {
2024-03-16 18:35:31 +01:00
PauseIcon,
PlayIcon,
2023-08-27 22:20:34 +02:00
},
computed: {
...mapState(usePlayer, ['paused']),
},
methods: {
...mapActions(usePlayer, ['play', 'pause']),
2023-08-28 17:44:17 +02:00
},
2023-08-27 22:20:34 +02:00
}
</script>
2023-08-28 00:02:07 +02:00
<style scoped>
.controls {
display: flex;
}
2023-08-28 21:25:12 +02:00
.pointer {
cursor: pointer;
}
2023-08-28 00:02:07 +02:00
</style>