// @flow
import React from 'react';
import type { ComponentType } from 'react';
import { withTheme } from 'styled-components';
import type { ThemeProps } from '../../../../types';
import type { BrandProps } from '../../../../mixins/branding';
import { getChevronColor } from '../css-rules';

const _SmallChevronLeft = ({
  colorName = 'greyscale-dark',
  theme,
}: BrandProps & ThemeProps) => (
  <svg
    xmlns="http://www.w3.org/2000/svg"
    width="10"
    height="10"
    viewBox="0 0 10 10"
  >
    <path
      fill="none"
      fillRule="evenodd"
      stroke={getChevronColor(theme, colorName)}
      strokeLinecap="round"
      strokeWidth="1.5"
      d="M7 9L3 5l4-4"
    />
  </svg>
);

export const SmallChevronLeft: ComponentType<{}> = withTheme(_SmallChevronLeft);

SmallChevronLeft.displayName = 'SmallChevronLeft';

export { getSmallChevronLeftDataUri } from './chevron-left.css-rules';
