import React from "react";
import Header from "./legend-header";

class LegendItemMultiple extends React.Component {
  render() {
    const { layer, images } = this.props;

    return (
      <li className="cm-list-group-item corpsmap-legend-item-multiple">
        <Header layer={layer} />
        {images.map((image, i) => {
          return (
            <div key={i}>
              {typeof image === "string" ? (
                image
              ) : (
                <img alt={image.alt} src={image.src}></img>
              )}
              {layer.type === "WMS" ? null : image.title}
            </div>
          );
        })}
      </li>
    );
  }
}
export default LegendItemMultiple;
