import { Box, Flex, Image, Text } from '@chakra-ui/react'
import {
Step,
StartStep,
BubbleStepType,
InputStepType,
LogicStepType,
IntegrationStepType,
} from 'models'
import { ChoiceItemsList } from '../ChoiceInputStepNode/ChoiceItemsList'
import { ConditionNodeContent } from './ConditionNodeContent'
import { SetVariableNodeContent } from './SetVariableNodeContent'
import { VideoStepNodeContent } from './VideoStepNodeContent'
import { WebhookContent } from './WebhookContent'
type Props = {
step: Step | StartStep
isConnectable?: boolean
}
export const StepNodeContent = ({ step }: Props) => {
switch (step.type) {
case BubbleStepType.TEXT: {
return (
Click to edit...
`
: step.content.html,
}}
/>
)
}
case BubbleStepType.IMAGE: {
return !step.content?.url ? (
Click to edit...
) : (
)
}
case BubbleStepType.VIDEO: {
return
}
case InputStepType.TEXT: {
return (
{step.options?.labels?.placeholder ?? 'Type your answer...'}
)
}
case InputStepType.NUMBER: {
return (
{step.options?.labels?.placeholder ?? 'Type your answer...'}
)
}
case InputStepType.EMAIL: {
return (
{step.options?.labels?.placeholder ?? 'Type your email...'}
)
}
case InputStepType.URL: {
return (
{step.options?.labels?.placeholder ?? 'Type your URL...'}
)
}
case InputStepType.DATE: {
return (
{step.options?.labels?.from ?? 'Pick a date...'}
)
}
case InputStepType.PHONE: {
return (
{step.options?.labels?.placeholder ?? 'Your phone number...'}
)
}
case InputStepType.CHOICE: {
return
}
case LogicStepType.SET_VARIABLE: {
return
}
case LogicStepType.CONDITION: {
return
}
case LogicStepType.REDIRECT: {
if (!step.options.url) return Configure...
return Redirect to {step.options?.url}
}
case IntegrationStepType.GOOGLE_SHEETS: {
if (!step.options) return Configure...
return {step.options?.action}
}
case IntegrationStepType.GOOGLE_ANALYTICS: {
if (!step.options || !step.options.action)
return Configure...
return Track "{step.options?.action}"
}
case IntegrationStepType.WEBHOOK: {
return
}
case 'start': {
return {step.label}
}
default: {
return No input
}
}
}