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 5L13 10L12.3 10.7L8 6.4L3.7 10.7L3 10L8 5Z" />
  </svg>
);

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

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