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="iconCSS">
      <path
        id="Vector"
        d="M3.33329 2L2.89996 4.22667H11.96L11.6666 5.66667H2.61329L2.17329 7.88667H11.2333L10.7266 10.4267L7.07329 11.6333L3.90662 10.4267L4.12662 9.33333H1.89996L1.37329 12L6.60662 14L12.64 12L13.44 7.98L13.6 7.17333L14.6266 2H3.33329Z"
        fill="#3B3C45"
      />
    </g>
  </svg>
);

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

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