2025-03-30 16:42:51 -03:00
|
|
|
import React from 'react';
|
|
|
|
import { Album } from "../data/albums"
|
|
|
|
|
|
|
|
interface AlbumArtworkProps {
|
|
|
|
album: Album
|
|
|
|
aspectRatio?: "portrait" | "square"
|
|
|
|
width?: number
|
|
|
|
height?: number
|
|
|
|
}
|
|
|
|
|
|
|
|
export function AlbumArtwork({
|
|
|
|
album,
|
|
|
|
aspectRatio = "portrait",
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
}: AlbumArtworkProps) {
|
|
|
|
return (
|
2025-03-30 19:28:28 -03:00
|
|
|
<div className="mr-4">
|
|
|
|
<div className="overflow-hidden rounded-md">
|
|
|
|
<img
|
|
|
|
src={album.cover}
|
|
|
|
alt={album.name}
|
|
|
|
className={`object-cover transition-all hover:scale-105 ${aspectRatio === "portrait" ? "aspect-[3/4]" : "aspect-square"}`}
|
|
|
|
style={{
|
|
|
|
width: width,
|
|
|
|
height: height,
|
|
|
|
}}
|
2025-03-30 16:42:51 -03:00
|
|
|
/>
|
2025-03-30 19:28:28 -03:00
|
|
|
</div>
|
|
|
|
<div className="mt-2 space-y-1 text-sm">
|
|
|
|
<h3 className="font-medium leading-none">{album.name}</h3>
|
|
|
|
<p className="text-xs text-gray-500">{album.artist}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
2025-03-30 16:42:51 -03:00
|
|
|
}
|