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 14 12" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
    <path
      d="M8 9L8.707 8.293L10.5 10.086V0H11.5V10.086L13.293 8.293L14 9L11 12L8 9Z"
      fill="#22242B"
    />
    <path d="M7 7H0V8H7V7Z" fill="#22242B" />
    <path d="M7 4H2V5H7V4Z" fill="#22242B" />
    <path d="M7 1H4V2H7V1Z" fill="#22242B" />
  </svg>
);

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

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