mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
feat: 增加歌手页面
This commit is contained in:
parent
7d20e6c5de
commit
36603dc3a0
16 changed files with 247 additions and 28 deletions
|
|
@ -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 ? ', ' : ''}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue