"use client";

/**
 * Invoice media comes from arbitrary uploaded URLs that regularly 404, and the
 * placeholder swap is an `onError` handler — a browser event, so this thumbnail
 * is the one fragment of the invoice section that cannot render on the server.
 */
export default function InvoiceImage({ src }: { src: string }) {
  return (
    /* eslint-disable-next-line @next/next/no-img-element */
    <img
      src={src}
      alt="invoice"
      onError={(e) => {
        e.currentTarget.src = "/logo.png";
      }}
      className="h-32 w-full rounded-lg object-cover ring-1 ring-gray-100"
    />
  );
}
