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

const FlightIcon = 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_5828)">
          <path
            d="M22 16V14L13.5789 9V3.5C13.5789 2.67 12.8737 2 12 2C11.1263 2 10.4211 2.67 10.4211 3.5V9L2 14V16L10.4211 13.5V19L8.31579 20.5V22L12 21L15.6842 22V20.5L13.5789 19V13.5L22 16Z"
            fill={getObjectValue(
              props.theme.colors,
              props.iconColor,
              props.theme.colors.grey.deep,
            )}
          />
        </g>
        <defs>
          <clipPath id="clip0_2140_5828">
            <rect width="24" height="24" fill="white" />
          </clipPath>
        </defs>
      </svg>
    </IconWrapper>
  );
};

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

export default withTheme(FlightIcon);
