import React from 'react'; import { useTranslation } from 'react-i18next'; import { AudioLines, ChevronRight, Play, Square, X } from 'lucide-react'; import type { ColDef } from '@/lib/hooks/useTracklistColumns'; import type { SubsonicSong } from '@/lib/api/subsonicTypes'; import { codecLabel } from '@/lib/format/playlistDetailHelpers'; import { formatLastSeen } from '@/lib/format/userMgmtHelpers'; import i18n from '@/lib/i18n'; import { formatTrackTime } from '@/lib/format/formatDuration'; import StarRating from '@/ui/StarRating'; import { OpenArtistRefInline } from '@/features/artist'; import { resolveTrackArtistRefs } from '@/features/playback/utils/playback/trackArtistRefs'; export interface FavoriteSongRowCallbacks { activate: (song: SubsonicSong, index: number, e: React.MouseEvent) => void; dblOrbit: (songId: string, e: React.MouseEvent) => void; context: (song: SubsonicSong, e: React.MouseEvent) => void; mouseDownRow: (song: SubsonicSong, e: React.MouseEvent) => void; toggleSelect: (songId: string, index: number, shift: boolean) => void; play: (index: number) => void; startPreview: (song: SubsonicSong) => void; rate: (songId: string, rating: number) => void; remove: (songId: string) => void; navArtist: (artistId: string, serverId?: string) => void; navAlbum: (albumId: string, serverId?: string) => void; } interface Props { song: SubsonicSong; index: number; visibleCols: ColDef[]; gridStyle: React.CSSProperties; showBitrate: boolean; isActive: boolean; showEq: boolean; isSelected: boolean; inSelectMode: boolean; ratingValue: number; isPreviewing: boolean; previewStarted: boolean; orbitActive: boolean; cb: FavoriteSongRowCallbacks; } function FavoriteSongRow({ song, index: i, visibleCols, gridStyle, showBitrate, isActive, showEq, isSelected, inSelectMode, ratingValue, isPreviewing, previewStarted, orbitActive, cb, }: Props) { const { t } = useTranslation(); return (