'use client';
import { useState } from 'react';
import { CoverPlaceholder } from './CoverPlaceholder';
type Props = { src?: string; alt?: string; size: number };
export function Cover({ src, alt, size }: Props) {
const [errored, setErrored] = useState(false);
if (!src || errored) return ;
return (
setErrored(true)}
className="block rounded-md object-cover"
style={{ width: size, height: size }}
/>
);
}