import React from 'react';
import styled from 'styled-components';

import type { IconProps } from '@redocly/theme/icons/types';

import { getCssColorVariable } from '@redocly/theme/core/utils';

const Icon = (props: IconProps) => (
  <svg
    width="16"
    height="16"
    viewBox="0 0 16 16"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
    {...props}
  >
    <g id="iconHTML">
      <path
        id="Vector"
        d="M8.00005 11.7067L10.7134 10.9533L11.08 6.88667H6.25338L6.13338 5.53333H11.2L11.3334 4.20667H4.66671L5.04005 8.21333H9.63338L9.48005 9.93333L8.00005 10.3333L6.52005 9.93333L6.42671 8.82667H5.09338L5.28671 10.9533L8.00005 11.7067ZM2.71338 2H13.2867L12.3334 12.8L8.00005 14L3.66671 12.8L2.71338 2Z"
        fill="#3B3C45"
      />
    </g>
  </svg>
);

export const DocumentHtmlIcon = styled(Icon).attrs({
  'data-component-name': 'icons/DocumentHtmlIcon/DocumentHtmlIcon',
})`
  path {
    fill: ${({ color }) => getCssColorVariable(color)};
  }

  height: ${({ size }) => size || '16px'};
  width: ${({ size }) => size || '16px'};
`;
