mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
use JoinedArtists in columns
This commit is contained in:
@@ -1,4 +1,28 @@
|
||||
import { ItemDetailListCellProps } from './types';
|
||||
|
||||
export const AlbumArtistColumn = ({ song }: ItemDetailListCellProps) =>
|
||||
song.albumArtistName ?? <> </>;
|
||||
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 <> </>;
|
||||
|
||||
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 ?? <> </>;
|
||||
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 <> </>;
|
||||
|
||||
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}
|
||||
|
||||
Reference in New Issue
Block a user