// @flow
import React, { useContext } from 'react';
import { ThemeContext } from 'styled-components';
import { getChevronColor } from '../css-rules';
import type { SmallChevronDownProps } from './small-chevron-down.proptypes';

export const SmallChevronDown = ({
  colorName = 'greyscale-dark',
  className = '',
}: SmallChevronDownProps) => {
  const theme = useContext(ThemeContext);
  return (
    <svg className={className} width="10" height="10" viewBox="0 0 10 10">
      <path
        fill="none"
        fillRule="evenodd"
        stroke={getChevronColor(theme, colorName)}
        strokeLinecap="round"
        strokeWidth="1.5"
        d="M9 3L5 7 1 3"
      />
    </svg>
  );
};

SmallChevronDown.displayName = 'SmallChevronDown';
