mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-12 18:59:38 -06:00
add thankyou card to surveys. --------- Co-authored-by: Johannes <johannes@formbricks.com> Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
34 lines
929 B
TypeScript
34 lines
929 B
TypeScript
import type { Question } from "@formbricks/types/questions";
|
|
import OpenTextQuestion from "./OpenTextQuestion";
|
|
import MultipleChoiceSingleQuestion from "./MultipleChoiceSingleQuestion";
|
|
|
|
interface QuestionConditionalProps {
|
|
currentQuestion: Question;
|
|
onSubmit: (data: { [x: string]: any }) => void;
|
|
lastQuestion: boolean;
|
|
brandColor: string;
|
|
}
|
|
|
|
export default function QuestionConditional({
|
|
currentQuestion,
|
|
onSubmit,
|
|
lastQuestion,
|
|
brandColor,
|
|
}: QuestionConditionalProps) {
|
|
return currentQuestion.type === "openText" ? (
|
|
<OpenTextQuestion
|
|
question={currentQuestion}
|
|
onSubmit={onSubmit}
|
|
lastQuestion={lastQuestion}
|
|
brandColor={brandColor}
|
|
/>
|
|
) : currentQuestion.type === "multipleChoiceSingle" ? (
|
|
<MultipleChoiceSingleQuestion
|
|
question={currentQuestion}
|
|
onSubmit={onSubmit}
|
|
lastQuestion={lastQuestion}
|
|
brandColor={brandColor}
|
|
/>
|
|
) : null;
|
|
}
|