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="iconMarkdown">
      <path
        id="Vector"
        d="M1.5 10.5003V5.16699H2.83333L4.83333 7.16699L6.83333 5.16699H8.16667V10.5003H6.83333V7.05366L4.83333 9.05366L2.83333 7.05366V10.5003H1.5ZM10.8333 5.16699H12.8333V7.83366H14.5L11.8333 10.8337L9.16667 7.83366H10.8333V5.16699Z"
        fill="#3B3C45"
      />
    </g>
  </svg>
);

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

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