feat(engine): ✨ Add Rating input
This commit is contained in:
@ -22,6 +22,7 @@ import { ConfigureContent } from './contents/ConfigureContent'
|
||||
import { ImageBubbleContent } from './contents/ImageBubbleContent'
|
||||
import { PaymentInputContent } from './contents/PaymentInputContent'
|
||||
import { PlaceholderContent } from './contents/PlaceholderContent'
|
||||
import { RatingInputContent } from './contents/RatingInputContent'
|
||||
import { SendEmailContent } from './contents/SendEmailContent'
|
||||
import { TypebotLinkContent } from './contents/TypebotLinkContent'
|
||||
import { ProviderWebhookContent } from './contents/ZapierContent'
|
||||
@ -30,7 +31,7 @@ type Props = {
|
||||
step: Step | StartStep
|
||||
indices: StepIndices
|
||||
}
|
||||
export const StepNodeContent = ({ step, indices }: Props) => {
|
||||
export const StepNodeContent = ({ step, indices }: Props): JSX.Element => {
|
||||
if (isInputStep(step) && !isChoiceInput(step) && step.options.variableId) {
|
||||
return <WithVariableContent step={step} />
|
||||
}
|
||||
@ -72,6 +73,9 @@ export const StepNodeContent = ({ step, indices }: Props) => {
|
||||
case InputStepType.PAYMENT: {
|
||||
return <PaymentInputContent step={step} />
|
||||
}
|
||||
case InputStepType.RATING: {
|
||||
return <RatingInputContent step={step} />
|
||||
}
|
||||
case LogicStepType.SET_VARIABLE: {
|
||||
return <SetVariableContent step={step} />
|
||||
}
|
||||
@ -144,8 +148,5 @@ export const StepNodeContent = ({ step, indices }: Props) => {
|
||||
case 'start': {
|
||||
return <Text>Start</Text>
|
||||
}
|
||||
default: {
|
||||
return <Text>No input</Text>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
import { Text } from '@chakra-ui/react'
|
||||
import { RatingInputStep } from 'models'
|
||||
|
||||
type Props = {
|
||||
step: RatingInputStep
|
||||
}
|
||||
|
||||
export const RatingInputContent = ({ step }: Props) => (
|
||||
<Text noOfLines={0} pr="6">
|
||||
Rate from 1 to {step.options.length}
|
||||
</Text>
|
||||
)
|
Reference in New Issue
Block a user