import React from 'react'; import { useTranslation } from 'react-i18next'; import { AudioLines, ChevronRight, Heart, Play, Square, Trash2 } from 'lucide-react'; import type { ColDef } from '../../utils/useTracklistColumns'; import type { SubsonicSong } from '../../api/subsonicTypes'; import { codecLabel } from '../../utils/componentHelpers/playlistDetailHelpers'; import { formatLastSeen } from '../../utils/componentHelpers/userMgmtHelpers'; import i18n from '../../i18n'; import { formatTrackTime } from '../../utils/format/formatDuration'; import StarRating from '../StarRating'; export interface PlaylistRowCallbacks { activate: (song: SubsonicSong, index: number, e: React.MouseEvent) => void; dblOrbit: (songId: string, e: React.MouseEvent) => void; context: (song: SubsonicSong, realIdx: number, e: React.MouseEvent) => void; mouseDownRow: (realIdx: number, e: React.MouseEvent) => void; mouseEnterRow: (index: number, e: React.MouseEvent) => void; toggleSelect: (songId: string, index: number, shift: boolean) => void; play: (index: number) => void; startPreview: (song: SubsonicSong) => void; toggleStar: (song: SubsonicSong, e: React.MouseEvent) => void; rate: (songId: string, rating: number) => void; remove: (realIdx: number) => void; navArtist: (artistId: string) => void; navAlbum: (albumId: string) => void; } interface Props { song: SubsonicSong; index: number; realIdx: number; visibleCols: ColDef[]; gridStyle: React.CSSProperties; showBitrate: boolean; isActive: boolean; showEq: boolean; isContextActive: boolean; isSelected: boolean; inSelectMode: boolean; isStarred: boolean; ratingValue: number; isPreviewing: boolean; previewStarted: boolean; orbitActive: boolean; cb: PlaylistRowCallbacks; } function PlaylistRow({ song, index: i, realIdx, visibleCols, gridStyle, showBitrate, isActive, showEq, isContextActive, isSelected, inSelectMode, isStarred, ratingValue, isPreviewing, previewStarted, orbitActive, cb, }: Props) { const { t } = useTranslation(); return (