forked from nsjcy/frontEnd/nsjcy

liuwh
2020-03-29 bc647c5e5e95f3898e3af66c02d7911df8547b4e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import React from 'react';
 
const QuestionnairAnswer = ({
  answer
}) => {
  return (
    <div style={{ minHeight: 60 }}>
      <div style={{ color: '#666' }}>{`${index + 1}.${answer.type === 'input' ? answer.completionForwards : answer.title + ':'}`}</div>
      <div style={{ paddingLeft: 12, color: '#151515' }}>{typeof answer.answer[answer.type] !== 'string' ? (
        typeof answer.answer[answer.type].optionValue !== 'string' ? (
          answer.answer[answer.type].optionValue.map((item, index) => {
            return (
              item && <span key={index} style={{ marginRight: 15 }}>{item}</span>
            )
          })
        ) : answer.answer[answer.type].optionValue
      ) : answer.answer[answer.type]}</div>
    </div>
  );
}
 
export default QuestionnairAnswer;