mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
spotify: image size, move interface
This commit is contained in:
parent
2e4d490120
commit
9139f4dc18
2 changed files with 18 additions and 13 deletions
|
@ -1,3 +1,4 @@
|
|||
import type { SpotifyData } from '@/utils/interface'
|
||||
import { HiMusicNote } from 'react-icons/hi'
|
||||
import { truncate } from '@/utils/truncate'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
@ -5,16 +6,6 @@ import io from 'socket.io-client'
|
|||
import Image from 'next/image'
|
||||
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 = () => {
|
||||
const [spotify, setSpotify] = useState<SpotifyData>()
|
||||
|
||||
|
@ -35,8 +26,8 @@ export const NowPlayingCard = () => {
|
|||
{spotify?.is_playing ? (
|
||||
<>
|
||||
<Image
|
||||
height={45}
|
||||
width={45}
|
||||
width={60}
|
||||
height={60}
|
||||
alt='Song cover art'
|
||||
quality={100}
|
||||
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='text-l sm:text-regular font-semibold'>
|
||||
Not listening to anything
|
||||
|
|
|
@ -18,3 +18,17 @@ export interface Item {
|
|||
external_urls: { spotify: string }
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue