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

type ToastMessage = {
  id?: string,
  text: TranslatedContent,
  onClose?: (toastId?: string) => void,
  timerDelay?: number,
  level?: Level,
};

export type ToastCentreProps = {
  messages: ToastMessage[],
};

export const toastCentrePropTypes = {
  messages: PropTypes.arrayOf(
    PropTypes.shape({
      id: PropTypes.string,
      text: translatedContentPropType.isRequired,
      onClose: PropTypes.func,
      timerDelay: PropTypes.number,
      level: PropTypes.string,
    }),
  ),
};
