import PropTypes from 'prop-types';
import Segment from '../shared/segment';
import { DEFAULT_COLOR } from './utils';

function Question(props) {
  return (
    <Segment id='question' color={DEFAULT_COLOR} colorWeight={300} borderWeight={2}>
      <span className='font-semibold'>سوال:</span>
      <div dangerouslySetInnerHTML={{ __html: props.question }} />
    </Segment>
  );
}

Question.defaultProps = { color: DEFAULT_COLOR };

Question.propTypes = {
  question: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired
};

export default Question;
