spotify: image size, move interface

This commit is contained in:
skidoodle 2024-01-01 20:55:07 +01:00
parent 2e4d490120
commit 9139f4dc18
2 changed files with 18 additions and 13 deletions

View file

@ -1,3 +1,4 @@
import type { SpotifyData } from '@/utils/interface'
import { HiMusicNote } from 'react-icons/hi' import { HiMusicNote } from 'react-icons/hi'
import { truncate } from '@/utils/truncate' import { truncate } from '@/utils/truncate'
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
@ -5,16 +6,6 @@ import io from 'socket.io-client'
import Image from 'next/image' import Image from 'next/image'
import Link from 'next/link' import Link from 'next/link'
interface SpotifyData {
is_playing?: boolean
title: string
artists: { name: string[] }
album: { image: string }
url: string
progress: number
duration: number
}
export const NowPlayingCard = () => { export const NowPlayingCard = () => {
const [spotify, setSpotify] = useState<SpotifyData>() const [spotify, setSpotify] = useState<SpotifyData>()
@ -35,8 +26,8 @@ export const NowPlayingCard = () => {
{spotify?.is_playing ? ( {spotify?.is_playing ? (
<> <>
<Image <Image
height={45} width={60}
width={45} height={60}
alt='Song cover art' alt='Song cover art'
quality={100} quality={100}
className='select-none rounded-md' className='select-none rounded-md'
@ -69,7 +60,7 @@ export const NowPlayingCard = () => {
</> </>
) : ( ) : (
<> <>
<HiMusicNote size={45} className='p-2.5' /> <HiMusicNote size={60} className='p-2.5' />
<div className='my-auto ml-4'> <div className='my-auto ml-4'>
<div className='text-l sm:text-regular font-semibold'> <div className='text-l sm:text-regular font-semibold'>
Not listening to anything Not listening to anything

View file

@ -18,3 +18,17 @@ export interface Item {
external_urls: { spotify: string } external_urls: { spotify: string }
duration_ms: number duration_ms: number
} }
export interface SpotifyData {
is_playing?: boolean
title: string
artists: { name: string[] }
album: { image: string }
url: string
progress: number
duration: number
}
export interface ErrorProps {
statusCode?: number
}