From a29ad0873ea86579688d5d8a198c640b072f3252 Mon Sep 17 00:00:00 2001 From: JSC Date: Fri, 18 Jul 2025 22:38:45 +0200 Subject: [PATCH] feat: add dropdown menu for track links in MusicPlayer component --- src/components/MusicPlayer.tsx | 79 +++++++++++++++++++++++++++++++--- 1 file changed, 74 insertions(+), 5 deletions(-) diff --git a/src/components/MusicPlayer.tsx b/src/components/MusicPlayer.tsx index 0a96f4d..bd762b5 100644 --- a/src/components/MusicPlayer.tsx +++ b/src/components/MusicPlayer.tsx @@ -2,6 +2,12 @@ import { useRef } from 'react' import { Button } from '@/components/ui/button' import { Card } from '@/components/ui/card' import { Separator } from '@/components/ui/separator' +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from '@/components/ui/dropdown-menu' import { useMusicPlayer } from '@/contexts/MusicPlayerContext' import { Play, @@ -18,7 +24,10 @@ import { Maximize2, Minimize2, Minus, - ArrowRightToLine + ArrowRightToLine, + ExternalLink, + Download, + Globe } from 'lucide-react' import { formatDuration } from '@/lib/format-duration' @@ -154,9 +163,39 @@ export function MusicPlayer() {
{/* Track info */}
-

- {currentTrack?.title || 'No track selected'} -

+
+ {(currentTrack?.file_url || currentTrack?.service_url) && ( + + + + + + {currentTrack?.file_url && ( + window.open(currentTrack.file_url, '_blank')}> + + Open File + + )} + {currentTrack?.service_url && ( + window.open(currentTrack.service_url, '_blank')}> + + Open Service + + )} + + + )} +

+ {currentTrack?.title || 'No track selected'} +

+
{currentTrack?.artist && (

{currentTrack.artist} @@ -307,7 +346,37 @@ export function MusicPlayer() { {/* Track info */}

-

{currentTrack?.title || 'No track selected'}

+
+ {(currentTrack?.file_url || currentTrack?.service_url) && ( + + + + + + {currentTrack?.file_url && ( + window.open(currentTrack.file_url, '_blank')}> + + Open File + + )} + {currentTrack?.service_url && ( + window.open(currentTrack.service_url, '_blank')}> + + Open Service + + )} + + + )} +

{currentTrack?.title || 'No track selected'}

+
{currentTrack?.artist && (

{currentTrack.artist}

)}