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="M8 10.9998L3 5.9998L3.7 5.2998L8 9.5998L12.3 5.2998L13 5.9998L8 10.9998Z" />
  </svg>
);

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

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