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

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

    return (
      <li className="cm-list-group-item corpsmap-legend-item">
        <Header layer={layer} />
        {typeof image === "string" ? (
          image
        ) : (
          <img alt={image.alt} src={image.src}></img>
        )}
      </li>
    );
  }
}
export default LegendItem;
