+
+ {!loadingSuggestions && filteredSuggestions.length === 0 && (
+
+ {visibleCols.map((colDef) => {
+ const key = colDef.key;
+ const isCentered = PL_CENTERED.has(key);
+ const label = colDef.i18nKey ? t(`albumDetail.${colDef.i18nKey}`) : '';
+ if (key === 'num') return
#
;
+ if (key === 'title') return
{label}
;
+ if (key === 'delete') return
;
+ if (key === 'favorite' || key === 'rating') return
;
+ return
{label}
;
+ })}
+
setHoveredSuggestionId(song.id)}
+ onMouseLeave={() => setHoveredSuggestionId(null)}
+ onDoubleClick={e => {
+ if ((e.target as HTMLElement).closest('button, a, input')) return;
+ addSong(song);
+ }}
+ onContextMenu={e => {
+ e.preventDefault();
+ setContextMenuSongId(song.id);
+ openContextMenu(e.clientX, e.clientY, songToTrack(song), 'album-song');
+ }}
+ >
+ {visibleCols.map(colDef => {
+ switch (colDef.key) {
+ case 'num': return
{idx + 1}
;
+ case 'title': return (
+
+
+
+
{song.title}
+
+ );
+ case 'artist': return (
+
+ { if (song.artistId) { e.stopPropagation(); navigate(`/artist/${song.artistId}`); } }}>{song.artist}
+
+ );
+ case 'album': return (
+
+ { if (song.albumId) { e.stopPropagation(); navigate(`/album/${song.albumId}`); } }}>{song.album}
+
+ );
+ case 'favorite': return
;
+ case 'rating': return
;
+ case 'duration': return
{formatDuration(song.duration ?? 0)}
;
+ case 'format': return (
+
+ {(song.suffix || (showBitrate && song.bitRate)) && {codecLabel(song, showBitrate)}}
+
+ );
+ case 'delete': return (
+
+
+
+ );
+ default: return null;
+ }
+ })}
+