import React, { useState } from "react";
import noproductimage from "@/images/no--product-image.jpg";
const DefaultImage = ({
  //   src,
  alt = "Image",
  width = "30%",
  height = "30%",
  className = "mx-auto h-10 w-10 cursor-pointer rounded object-cover",
}) => {
  const [imageSrc, setImageSrc] = useState(noproductimage.src || "");

  return (
    <img
      src={imageSrc}
      alt={alt}
      width={width}
      height={height}
      className={className}
      //   onError={() => setImageSrc("/images/default-image.png")}
      style={{
        objectFit: "cover",
      }}
    />
  );
};

export default DefaultImage;
