This commit is contained in:
zadit
2025-01-07 16:31:54 +07:00
parent 0c99be55ec
commit 8e8eab48c1
2 changed files with 20 additions and 21 deletions

View File

@@ -85,9 +85,9 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
const fetchColor = async () => {
if (
currentSong &&
currentSong.image
currentSong[0]?.image
) {
const imageUrl = currentSong.image;
const imageUrl = currentSong[0].image;
try {
const dominantColor = await getDominantColor(imageUrl);
// Calculate luminance (YIQ color space) to determine if subtitle should be black or white
@@ -429,8 +429,8 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
<div className="current-info" >
<div
className={`current-name ${viewing ? '' : 'animated-text'}`} style={{ margin: `${viewing ? '35px 30px' : '13px 30px'}` }}>
{currentSong && currentSong.name
? (viewing ? currentSong.name : text)
{currentSong && currentSong[0]?.name
? (viewing ? currentSong[0]?.name : text)
:
viewing ? messages[0] : text}
</div>
@@ -438,9 +438,8 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
<div className="current-artist">
{
currentSong &&
currentSong.image &&
currentSong.artist
? currentSong.artist
currentSong[0]?.artist
? currentSong[0]?.artist
: "Pilih hits terbaikmu dibawah!"}
</div>
</>
@@ -512,14 +511,14 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
<MusicComponent
key={index}
song={song}
min={-100}
max={100}
onDecision={(vote) => onDecision(song.trackId, vote)}
min={song[3]? 0 : -100}
max={song[3]? 0 : 100}
onDecision={(vote) => onDecision(song[0].trackId, vote)}
/>
))
)
}
{songName == "" && queue && queue.length > 0 && queue.length < 3 && (
{/* {songName == "" && queue && queue.length > 0 && queue.length < 3 && (
<div className="middle-text">
<span className="normal-text">Tambahkan musikmu</span>
@@ -530,7 +529,7 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
Cari musik
</button>
</div>
)}
)} */}
</div>