// @flow
import PropTypes from 'prop-types';
import type { TranslatedContent } from '../../../types';
import { translatedContentPropType } from '../../../types';
import { type SpaceProps, spacePropTypes } from '../../../mixins/spacing';

export type FilterBarProps = SpaceProps & {
  options: Array<{ value: string, label: TranslatedContent }>,
  onChange: (input: string) => void,
  selectedValue?: string,
};

export const filterBarPropTypes = {
  ...spacePropTypes,
  options: PropTypes.arrayOf(
    PropTypes.shape({
      value: PropTypes.string.isRequired,
      label: translatedContentPropType.isRequired,
    }).isRequired,
  ).isRequired,
  onChange: PropTypes.func.isRequired,
  selectedValue: PropTypes.string,
};
