Files
otunes/apps/web/components/artist-card.tsx
T

34 lines
1007 B
TypeScript

"use client"
import Image from "next/image"
import Link from "next/link"
import type { BrowseArtist } from "@/convex/library"
import { artistCoverUrl } from "@/lib/cover-urls"
export function ArtistCard({ artist }: { artist: BrowseArtist }) {
return (
<div className="group flex flex-col items-center gap-2">
<Link
className="relative flex aspect-square w-full items-center justify-center overflow-hidden rounded-full ring-1 ring-foreground/10"
href={"/artist/" + artist.id}
>
<Image
src={artistCoverUrl(artist.id)}
alt={artist.name}
fill
sizes="(max-width: 640px) 50vw, (max-width: 1024px) 25vw, 16vw"
className="object-cover"
/>
</Link>
<div className="min-w-0">
<Link href={"/artist/" + artist.id} className="hover:underline">
<p className="truncate text-center text-sm font-medium">
{artist.name}
</p>
</Link>
</div>
</div>
)
}