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

const BankIcon = props => {
  return (
    <IconWrapper {...props}>
      <svg
        width="24"
        height="24"
        viewBox="0 0 24 24"
        fill="none"
        xmlns="http://www.w3.org/2000/svg"
      >
        <g clipPath="url(#clip0_2140_5813)">
          <path
            d="M6.73684 11H4.63158V18H6.73684V11ZM13.0526 11H10.9474V18H13.0526V11ZM22 20H2V22H22V20ZM19.3684 11H17.2632V18H19.3684V11ZM12 4.26L17.4842 7H6.51579L12 4.26ZM12 2L2 7V9H22V7L12 2Z"
            fill={getObjectValue(
              props.theme.colors,
              props.iconColor,
              props.theme.colors.grey.deep,
            )}
          />
        </g>
        <defs>
          <clipPath id="clip0_2140_5813">
            <rect width="24" height="24" fill="white" />
          </clipPath>
        </defs>
      </svg>
    </IconWrapper>
  );
};

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

export default withTheme(BankIcon);
