-
-
-
+ {
+ const isEditingQuestion =
+ defaultSurveyFieldValues[
+ question.type
+ ].questions[0].question !==
+ question.question
+ const isEditingDescription =
+ defaultSurveyFieldValues[
+ question.type
+ ].questions[0].description !==
+ question.description
+ const isEditingThankYouMessage =
+ defaultSurveyFieldValues[
+ question.type
+ ].appearance
+ .thankYouMessageHeader !==
+ survey.appearance
+ .thankYouMessageHeader
+ setDefaultForQuestionType(
+ index,
+ newType,
+ isEditingQuestion,
+ isEditingDescription,
+ isEditingThankYouMessage
+ )
+ }}
+ options={[
+ {
+ label: SurveyQuestionLabel[
+ SurveyQuestionType.Open
+ ],
+ value: SurveyQuestionType.Open,
+ tooltip: () => (
+
+ undefined
+ }
+ appearance={{
+ ...survey.appearance,
+ whiteLabel: true,
+ }}
+ question={{
+ type: SurveyQuestionType.Open,
+ question:
+ 'Share your thoughts',
+ description:
+ 'Optional form description',
+ }}
+ />
+ ),
+ },
+ {
+ label: 'Link',
+ value: SurveyQuestionType.Link,
+ tooltip: () => (
+
+ undefined
+ }
+ appearance={{
+ ...survey.appearance,
+ whiteLabel: true,
+ }}
+ question={{
+ type: SurveyQuestionType.Link,
+ question:
+ 'Do you want to join our upcoming webinar?',
+ buttonText:
+ 'Register',
+ link: '',
+ }}
+ />
+ ),
+ },
+ {
+ label: 'Rating',
+ value: SurveyQuestionType.Rating,
+ tooltip: () => (
+
+ undefined
+ }
+ appearance={{
+ ...survey.appearance,
+ whiteLabel: true,
+ }}
+ ratingSurveyQuestion={{
+ question:
+ 'How satisfied are you with our product?',
+ description:
+ 'Optional form description.',
+ display: 'number',
+ lowerBoundLabel:
+ 'Not great',
+ upperBoundLabel:
+ 'Fantastic',
+ scale: 5,
+ type: SurveyQuestionType.Rating,
+ }}
+ />
+ ),
+ },
+ ...[
{
- label: 'Emoji',
- value: 'emoji',
+ label: 'Single choice select',
+ value: SurveyQuestionType.SingleChoice,
+ tooltip: () => (
+
+ undefined
+ }
+ appearance={{
+ ...survey.appearance,
+ whiteLabel:
+ true,
+ }}
+ multipleChoiceQuestion={{
+ type: SurveyQuestionType.SingleChoice,
+ choices: [
+ 'Yes',
+ 'No',
+ ],
+ question:
+ 'Have you found this tutorial useful?',
+ }}
+ />
+ ),
},
- ]}
- />
-
-
- (
+
+ undefined
+ }
+ appearance={{
+ ...survey.appearance,
+ whiteLabel:
+ true,
+ }}
+ multipleChoiceQuestion={{
+ type: SurveyQuestionType.MultipleChoice,
+ choices: [
+ 'Tutorials',
+ 'Customer case studies',
+ 'Product announcements',
+ ],
+ question:
+ 'Which types of content would you like to see more of?',
+ }}
+ />
+ ),
},
- ...(question.display ===
- 'number'
- ? [
- {
- label: '0 - 10',
- value: 10,
- },
- ]
- : []),
- ]}
- />
-
-
-
-
-
+
+
+
+
+
+
+ {({ value, onChange }) => (
+
+ )}
+
+ {survey.questions.length > 1 && (
+
+
+ )}
+ {question.type === SurveyQuestionType.Link && (
-
-
- )}
- {(question.type === SurveyQuestionType.SingleChoice ||
- question.type ===
- SurveyQuestionType.MultipleChoice) && (
-