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
    data-component-name="icons/DeselectIcon"
    viewBox="0 0 16 16"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
    {...props}
  >
    <path d="M14.4966 10.5H9.49658V11.5H14.4966V10.5Z" fill="currentColor" />
    <path d="M10.5 3.64746H1.5V4.64746H10.5V3.64746Z" fill="currentColor" />
    <path d="M10.5 6.64746H1.5V7.64746H10.5V6.64746Z" fill="currentColor" />
    <path d="M7.5 9.64746H1.5V10.6475H7.5V9.64746Z" fill="currentColor" />
  </svg>
);

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

  height: ${({ size }) => size || '1.3em'};
  width: ${({ size }) => size || '1.3em'};
  vertical-align: middle;
`;
