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 viewBox="0 0 13 8" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
    <path d="M13.5 7.5H11C10.7349 7.49964 10.4807 7.39417 10.2933 7.20671C10.1058 7.01925 10.0004 6.76511 10 6.5V3.5C10.0003 3.23488 10.1058 2.9807 10.2932 2.79323C10.4807 2.60576 10.7349 2.5003 11 2.5H13.5V3.5H11V6.5H13.5V7.5Z" />
    <path d="M8 2.5H6V0.5H5V7.5H8C8.26511 7.49964 8.51925 7.39417 8.70671 7.20671C8.89417 7.01925 8.99964 6.76511 9 6.5V3.5C8.9997 3.23488 8.89424 2.9807 8.70677 2.79323C8.5193 2.60576 8.26512 2.5003 8 2.5ZM6 6.5V3.5H8V6.5H6Z" />
    <path d="M3 0.5H1C0.734865 0.500265 0.480665 0.605707 0.293186 0.793186C0.105707 0.980665 0.000264738 1.23486 0 1.5V7.5H1V5H3V7.5H4V1.5C3.99974 1.23486 3.89429 0.980665 3.70681 0.793186C3.51934 0.605707 3.26514 0.500265 3 0.5ZM1 4V1.5H3V4H1Z" />
  </svg>
);

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

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