2022-04-15 14:24:30 +00:00
|
|
|
<template>
|
2022-04-15 17:00:08 +00:00
|
|
|
<BaseContextMenu extra-class="playlist-menu" ref="base">
|
2022-04-15 14:24:30 +00:00
|
|
|
<li @click="createPlaylist" data-testid="playlist-context-menu-create-simple">New Playlist</li>
|
|
|
|
<li @click="createSmartPlaylist" data-testid="playlist-context-menu-create-smart">New Smart Playlist</li>
|
2022-04-15 17:00:08 +00:00
|
|
|
</BaseContextMenu>
|
2022-04-15 14:24:30 +00:00
|
|
|
</template>
|
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
<script lang="ts" setup>
|
2022-04-15 14:24:30 +00:00
|
|
|
import { eventBus } from '@/utils'
|
2022-04-15 17:00:08 +00:00
|
|
|
import { useContextMenu } from '@/composables'
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
const { base, BaseContextMenu, open, close } = useContextMenu()
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
const emit = defineEmits(['createPlaylist'])
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
const createPlaylist = () => {
|
|
|
|
emit('createPlaylist')
|
|
|
|
close()
|
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
const createSmartPlaylist = () => {
|
|
|
|
eventBus.emit('MODAL_SHOW_CREATE_SMART_PLAYLIST_FORM')
|
|
|
|
close()
|
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
</script>
|