import React from "react";
import PropTypes from "prop-types";
import { withTheme } from "styled-components";
import { getObjectValue } from "../utils/util";
import IconWrapper from "../IconWrapper";

const CampaignIcon = props => {
  return (
    <IconWrapper {...props}>
      <svg
        width="20"
        height="20"
        viewBox="0 0 20 20"
        fill="none"
        xmlns="http://www.w3.org/2000/svg"
      >
        <path
          d="M16.4 2V3.6L3.6 6.8V5.2H2V14.8H3.6V13.2L5.2 13.6V15.2C5.2 16.72 6.48 18 8 18C9.52 18 10.8 16.72 10.8 15.2V15.04L16.4 16.4V18H18V2H16.4ZM9.2 15.2C9.2 15.84 8.64 16.4 8 16.4C7.36 16.4 6.8 15.84 6.8 15.2V14L9.2 14.64V15.2ZM16.4 14.8L3.6 11.6V8.4L16.4 5.2V14.8Z"
          fill={getObjectValue(
            props.theme.colors,
            props.iconColor,
            props.theme.colors.grey.deep,
          )}
        />
      </svg>
    </IconWrapper>
  );
};

CampaignIcon.propTypes = {
  iconColor: PropTypes.string,
};

export default withTheme(CampaignIcon);
