koel/resources/assets/js/components/layout/main-wrapper/extra-drawer/ExtraDrawerTabHeader.vue

63 lines
1.8 KiB
Vue
Raw Normal View History

2022-10-13 15:18:47 +00:00
<template>
2024-04-04 22:20:42 +00:00
<ExtraDrawerButton
2022-10-13 15:18:47 +00:00
id="extraTabLyrics"
v-koel-tooltip.left
2022-10-13 15:18:47 +00:00
:class="{ active: value === 'Lyrics' }"
title="Lyrics"
@click.prevent="toggleTab('Lyrics')"
>
2023-11-10 13:16:06 +00:00
<Icon :icon="faFeather" fixed-width />
2024-04-04 22:20:42 +00:00
</ExtraDrawerButton>
<ExtraDrawerButton
2022-10-13 15:18:47 +00:00
id="extraTabArtist"
v-koel-tooltip.left
2022-10-13 15:18:47 +00:00
:class="{ active: value === 'Artist' }"
title="Artist information"
@click.prevent="toggleTab('Artist')"
>
2023-11-10 13:16:06 +00:00
<Icon :icon="faMicrophone" fixed-width />
2024-04-04 22:20:42 +00:00
</ExtraDrawerButton>
<ExtraDrawerButton
2022-10-13 15:18:47 +00:00
id="extraTabAlbum"
v-koel-tooltip.left
2022-10-13 15:18:47 +00:00
:class="{ active: value === 'Album' }"
title="Album information"
@click.prevent="toggleTab('Album')"
>
2023-11-10 13:16:06 +00:00
<Icon :icon="faCompactDisc" fixed-width />
2024-04-04 22:20:42 +00:00
</ExtraDrawerButton>
<ExtraDrawerButton
2022-10-13 15:18:47 +00:00
v-if="useYouTube"
id="extraTabYouTube"
2022-12-02 16:17:37 +00:00
v-koel-tooltip.left
2022-10-13 15:18:47 +00:00
:class="{ active: value === 'YouTube' }"
title="Related YouTube videos"
@click.prevent="toggleTab('YouTube')"
>
2023-11-10 13:16:06 +00:00
<Icon :icon="faYoutube" fixed-width />
2024-04-04 22:20:42 +00:00
</ExtraDrawerButton>
2022-10-13 15:18:47 +00:00
</template>
<script lang="ts" setup>
import { faCompactDisc, faFeather, faMicrophone } from '@fortawesome/free-solid-svg-icons'
2022-10-13 15:18:47 +00:00
import { faYoutube } from '@fortawesome/free-brands-svg-icons'
import { computed } from 'vue'
import { useThirdPartyServices } from '@/composables'
2024-04-04 22:20:42 +00:00
import ExtraDrawerButton from '@/components/layout/main-wrapper/extra-drawer/ExtraDrawerButton.vue'
2022-10-13 15:18:47 +00:00
2022-12-02 16:17:37 +00:00
const props = withDefaults(defineProps<{ modelValue?: ExtraPanelTab | null }>(), {
modelValue: null
})
2022-10-13 15:18:47 +00:00
2022-12-02 16:17:37 +00:00
const emit = defineEmits<{ (e: 'update:modelValue', value: ExtraPanelTab | null): void }>()
2022-10-13 15:18:47 +00:00
const { useYouTube } = useThirdPartyServices()
const value = computed({
get: () => props.modelValue,
set: value => emit('update:modelValue', value)
})
2022-12-02 16:17:37 +00:00
const toggleTab = (tab: ExtraPanelTab) => (value.value = value.value === tab ? null : tab)
2022-10-13 15:18:47 +00:00
</script>