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

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

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

export default Answer;
