"use client"; import Image from "next/image"; import { motion } from "framer-motion"; import { useState } from "react"; import { ARTIST_PLACEHOLDER_SRC } from "@/lib/constants"; type Props = { src: string; alt: string; }; export function ReleaseCover({ src: initialSrc, alt }: Props) { const [imgError, setImgError] = useState(false); const [imgLoaded, setImgLoaded] = useState(false); const src = imgError ? ARTIST_PLACEHOLDER_SRC : initialSrc; return (
{alt} setImgLoaded(true)} onError={() => setImgError(true)} />
); }