import { Group, Stack } from '@mantine/core'; import { forwardRef, Ref } from 'react'; import { RiMoreFill } from 'react-icons/ri'; import { generatePath, useParams } from 'react-router'; import { Link } from 'react-router-dom'; import { DropdownMenu, Button } from '/@/renderer/components'; import { usePlayQueueAdd } from '/@/renderer/features/player'; import { usePlaylistDetail } from '/@/renderer/features/playlists/queries/playlist-detail-query'; import { LibraryHeader, PlayButton, PLAY_TYPES } from '/@/renderer/features/shared'; import { AppRoute } from '/@/renderer/router/routes'; import { usePlayButtonBehavior } from '/@/renderer/store/settings.store'; import { LibraryItem, Play } from '/@/renderer/types'; interface PlaylistDetailHeaderProps { background: string; imagePlaceholderUrl?: string | null; imageUrl?: string | null; } export const PlaylistDetailHeader = forwardRef( ( { background, imageUrl, imagePlaceholderUrl }: PlaylistDetailHeaderProps, ref: Ref, ) => { const { playlistId } = useParams() as { playlistId: string }; const detailQuery = usePlaylistDetail({ id: playlistId }); const handlePlayQueueAdd = usePlayQueueAdd(); const playButtonBehavior = usePlayButtonBehavior(); const handlePlay = (playType?: Play) => { handlePlayQueueAdd?.({ byItemType: { id: [playlistId], type: LibraryItem.PLAYLIST, }, play: playType || playButtonBehavior, }); }; return ( handlePlay()} /> {PLAY_TYPES.filter((type) => type.play !== playButtonBehavior).map((type) => ( handlePlay(type.play)} > {type.label} ))} Edit playlist ); }, );