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

import type { SpanProps } from '../span/span.proptypes';
import { spanPropTypes } from '../span/span.proptypes';

export type ClickableSpanProps = SpanProps & {
  children: string | Element<*>,
  onClick: (event: SyntheticEvent<HTMLButtonElement>) => void,
};

export const clickableSpanPropTypes = {
  ...spanPropTypes,
  children: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
    .isRequired,
  onClick: PropTypes.func.isRequired,
};
