use JoinedArtists in columns

This commit is contained in:
jeffvli
2026-02-09 03:12:00 -08:00
parent 775cb6be07
commit 2d01b8e3f7
4 changed files with 54 additions and 3 deletions
@@ -1,4 +1,28 @@
import { ItemDetailListCellProps } from './types';
export const AlbumArtistColumn = ({ song }: ItemDetailListCellProps) =>
song.albumArtistName ?? <>&nbsp;</>;
import { JoinedArtists } from '/@/renderer/features/albums/components/joined-artists';
import { Text } from '/@/shared/components/text/text';
export const AlbumArtistColumn = ({ isRowHovered, song }: ItemDetailListCellProps) => {
const name = song.albumArtistName?.trim() ?? '';
const hasArtists = name.length > 0 || (song.albumArtists?.length ?? 0) > 0;
if (!hasArtists) return <>&nbsp;</>;
if (!isRowHovered) {
return (
<Text component="span" isMuted size="sm">
{name}
</Text>
);
}
return (
<JoinedArtists
artistName={song.albumArtistName ?? ''}
artists={song.albumArtists ?? []}
linkProps={{ fw: 400, isMuted: true }}
rootTextProps={{ fw: 400, isMuted: true, size: 'sm' }}
/>
);
};
@@ -1,3 +1,28 @@
import { ItemDetailListCellProps } from './types';
export const ArtistColumn = ({ song }: ItemDetailListCellProps) => song.artistName ?? <>&nbsp;</>;
import { JoinedArtists } from '/@/renderer/features/albums/components/joined-artists';
import { Text } from '/@/shared/components/text/text';
export const ArtistColumn = ({ isRowHovered, song }: ItemDetailListCellProps) => {
const name = song.artistName?.trim() ?? '';
const hasArtists = name.length > 0 || (song.artists?.length ?? 0) > 0;
if (!hasArtists) return <>&nbsp;</>;
if (!isRowHovered) {
return (
<Text component="span" isMuted size="sm">
{name}
</Text>
);
}
return (
<JoinedArtists
artistName={song.artistName ?? ''}
artists={song.artists ?? []}
linkProps={{ fw: 400, isMuted: true }}
rootTextProps={{ fw: 400, isMuted: true, size: 'sm' }}
/>
);
};
@@ -6,6 +6,7 @@ export interface ItemDetailListCellProps {
controls?: ItemControls;
internalState?: ItemListStateActions;
isMutatingFavorite?: boolean;
isRowHovered?: boolean;
onFavoriteClick?: (song: Song) => void;
rowIndex?: number;
size?: 'compact' | 'default' | 'large';
@@ -242,6 +242,7 @@ const TrackRow = memo(
controls={controls}
internalState={internalState}
isMutatingFavorite={isMutatingFavorite}
isRowHovered={isRowHovered}
onFavoriteClick={onFavoriteClick}
rowIndex={rowIndex}
size={size}