2
0
Files
bot/apps/builder/src/features/blocks/inputs/textInput/components/TextInputNodeContent.tsx
Baptiste Arnaud 35300eaf34 ♻️ Introduce typebot v6 with events (#1013)
Closes #885
2023-11-08 15:34:16 +01:00

26 lines
793 B
TypeScript

import React from 'react'
import { Text } from '@chakra-ui/react'
import { WithVariableContent } from '@/features/graph/components/nodes/block/WithVariableContent'
import { TextInputBlock } from '@typebot.io/schemas'
import { defaultTextInputOptions } from '@typebot.io/schemas/features/blocks/inputs/text/constants'
type Props = {
options: TextInputBlock['options']
}
export const TextInputNodeContent = ({ options }: Props) => {
if (options?.variableId)
return (
<WithVariableContent
variableId={options?.variableId}
h={options.isLong ? '100px' : 'auto'}
/>
)
return (
<Text color={'gray.500'} h={options?.isLong ? '100px' : 'auto'}>
{options?.labels?.placeholder ??
defaultTextInputOptions.labels.placeholder}
</Text>
)
}