// @flow
import PropTypes from 'prop-types';
import { translatedContentPropType } from '../../../types';
import type { TranslatedContent } from '../../../types';

export type ClickableListItemProp = {
  id: string,
  text: TranslatedContent,
  disabled?: boolean,
};

export type ClickableListProps = {
  label: TranslatedContent,
  options: Array<ClickableListItemProp>,
  onClick: string => void,
  disabled?: boolean,
};

const listItem = {
  id: PropTypes.string.isRequired,
  text: translatedContentPropType.isRequired,
  loading: PropTypes.bool,
  disabled: PropTypes.bool,
};
export const clickableListPropTypes = {
  label: translatedContentPropType.isRequired,
  options: PropTypes.arrayOf(PropTypes.shape(listItem)),
  onClick: PropTypes.func,
  disabled: PropTypes.bool,
};
