// @flow
import type { Node } from 'react';
import PropTypes from 'prop-types';

import {
  translatedContentPropType,
  type TranslatedContent,
} from '../../../types';

type Tab = {
  id: string,
  label: TranslatedContent,
  content: TranslatedContent | Node,
};

export type TabSetProps = {
  selectedTabIndex?: number,
  onSelect?: (selectedTabIndex: number) => void,
  tabs: [Tab, Tab],
};

export const tabSetPropTypes = {
  selectedTabIndex: PropTypes.number,
  onSelect: PropTypes.func,
  tabs: PropTypes.arrayOf(
    PropTypes.shape({
      id: PropTypes.string.isRequired,
      label: translatedContentPropType.isRequired,
      content: translatedContentPropType.isRequired,
    }),
  ),
};
