feat: 增加歌手页面

This commit is contained in:
qier222 2022-03-23 01:21:22 +08:00
parent 7d20e6c5de
commit 36603dc3a0
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
16 changed files with 247 additions and 28 deletions

View file

@ -1,17 +1,29 @@
const ArtistInline = ({
artists,
className,
disableLink,
}: {
artists: Artist[]
className?: string
disableLink?: boolean
}) => {
if (!artists) return <div></div>
const navigate = useNavigate()
const handleClick = () => {
disableLink ? null : navigate(`/artist/${artists[0].id}`)
}
return (
<div className={classNames('line-clamp-1', className)}>
{artists.map((artist, index) => (
<span key={artist.name}>
<span className={classNames({ 'hover:underline': !!artist.id })}>
<span key={`${artist.id}-${artist.name}`}>
<span
onClick={handleClick}
className={classNames({
'hover:underline': !!artist.id && !disableLink,
})}
>
{artist.name}
</span>
{index < artists.length - 1 ? ', ' : ''}&nbsp;