show macOS warning one, don't show artist link if invalid

This commit is contained in:
Kendall Garner 2024-04-17 22:44:35 -07:00
parent 5d6503c1f4
commit ebd2f07447
No known key found for this signature in database
GPG key ID: 18D2767419676C87
2 changed files with 29 additions and 18 deletions

View file

@ -48,24 +48,33 @@ const handleRow = <T extends AnyLibraryItem>(t: TFunction, item: T, rule: ItemDe
const formatArtists = (isAlbumArtist: boolean) => (item: Album | Song) =>
(isAlbumArtist ? item.albumArtists : item.artists)?.map((artist, index) => (
<span key={artist.id}>
<span key={artist.id || artist.name}>
{index > 0 && <Separator />}
<Text
$link
component={Link}
overflow="visible"
size="md"
to={
artist.id
? generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL, {
albumArtistId: artist.id,
})
: ''
}
weight={500}
>
{artist.name || '—'}
</Text>
{artist.id ? (
<Text
$link
component={Link}
overflow="visible"
size="md"
to={
artist.id
? generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL, {
albumArtistId: artist.id,
})
: ''
}
weight={500}
>
{artist.name || '—'}
</Text>
) : (
<Text
overflow="visible"
size="md"
>
{artist.name || '-'}
</Text>
)}
</span>
));