diff --git a/src/components/SongInfoModal.tsx b/src/components/SongInfoModal.tsx index 3f77a353..7a73a681 100644 --- a/src/components/SongInfoModal.tsx +++ b/src/components/SongInfoModal.tsx @@ -5,6 +5,8 @@ import { usePlayerStore } from '../store/playerStore'; import { useShallow } from 'zustand/react/shallow'; import { getSong, SubsonicSong } from '../api/subsonic'; import { useTranslation } from 'react-i18next'; +import { copyTextToClipboard } from '../utils/serverMagicString'; +import { showToast } from '../utils/toast'; function formatDuration(s: number): string { const m = Math.floor(s / 60); @@ -28,6 +30,27 @@ function Row({ label, value }: { label: string; value: React.ReactNode }) { ); } +/** Title / Artist / Album: double-click the value cell to copy plain text. */ +function CopyableFieldRow({ label, text }: { label: string; text: string | null | undefined }) { + const { t } = useTranslation(); + if (!text || text === '—') return null; + const onDoubleClick = async (e: React.MouseEvent) => { + e.preventDefault(); + e.stopPropagation(); + const ok = await copyTextToClipboard(text); + if (ok) showToast(t('orbit.tooltipCopied'), 2000, 'info'); + else showToast(t('contextMenu.shareCopyFailed'), 3500, 'error'); + }; + return ( +