2
0
Files
bot/apps/builder/components/settings/SettingsContent.tsx
2021-12-23 13:49:24 +01:00

27 lines
850 B
TypeScript

import { Flex, Stack } from '@chakra-ui/react'
import { TypingEmulationSettings } from 'bot-engine'
import { useTypebot } from 'contexts/TypebotContext'
import React from 'react'
import { TypingEmulation } from './TypingEmulation'
export const SettingsContent = () => {
const { typebot, updateSettings } = useTypebot()
const handleTypingEmulationUpdate = (
typingEmulation: TypingEmulationSettings
) => {
if (!typebot) return
updateSettings({ ...typebot.settings, typingEmulation })
}
return (
<Flex h="full" w="full" justifyContent="center" align="flex-start">
<Stack p="6" rounded="md" borderWidth={1} w="600px" minH="500px" mt={10}>
<TypingEmulation
typingEmulation={typebot?.settings.typingEmulation}
onUpdate={handleTypingEmulationUpdate}
/>
</Stack>
</Flex>
)
}