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 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
    <path
      d="M9 11L9.707 10.293L11.5 12.086V2H12.5V12.086L14.293 10.293L15 11L12 14L9 11Z"
      fill="#22242B"
    />
    <path d="M8 3H1V4H8V3Z" fill="#22242B" />
    <path d="M8 6H3V7H8V6Z" fill="#22242B" />
    <path d="M8 9H5V10H8V9Z" fill="#22242B" />
  </svg>
);

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

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