import React from "react";

export default function productImage({ image }) {
    const location = window.location.origin;
    const defaultImage =
        "https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png";
    return (
        <img
            src={image ? `${location}/upload/${image}` : defaultImage}
            alt={"Product image"}
            className="block h-[68px] w-[68px] object-cover"
            loading="lazy"
        />
    );
}
