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

20 lines
695 B
TypeScript

import { WithVariableContent } from '@/features/graph/components/nodes/block/WithVariableContent'
import { Text } from '@chakra-ui/react'
import { RatingInputBlock } from '@typebot.io/schemas'
import { defaultRatingInputOptions } from '@typebot.io/schemas/features/blocks/inputs/rating/constants'
type Props = {
variableId?: string
block: RatingInputBlock
}
export const RatingInputContent = ({ variableId, block }: Props) =>
variableId ? (
<WithVariableContent variableId={variableId} />
) : (
<Text noOfLines={1} pr="6">
Rate from {block.options?.buttonType === 'Icons' ? 1 : 0} to{' '}
{block.options?.length ?? defaultRatingInputOptions.length}
</Text>
)