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

const RestaurantIcon = 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_5864)">
          <path
            d="M16.4444 6V14H19.7778V22H22V2C18.9333 2 16.4444 4.24 16.4444 6ZM10.8889 9H8.66667V2H6.44444V9H4.22222V2H2V9C2 11.21 3.98889 13 6.44444 13V22H8.66667V13C11.1222 13 13.1111 11.21 13.1111 9V2H10.8889V9Z"
            fill={getObjectValue(
              props.theme.colors,
              props.iconColor,
              props.theme.colors.grey.deep,
            )}
          />
        </g>
        <defs>
          <clipPath id="clip0_2140_5864">
            <rect width="24" height="24" fill="white" />
          </clipPath>
        </defs>
      </svg>
    </IconWrapper>
  );
};

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

export default withTheme(RestaurantIcon);
