2021-12-23 13:49:24 +01:00
|
|
|
import { Flex, Stack } from '@chakra-ui/react'
|
2022-01-06 09:40:56 +01:00
|
|
|
import { TypingEmulationSettings } from 'models'
|
|
|
|
import { useTypebot } from 'contexts/TypebotContext/TypebotContext'
|
2021-12-23 13:49:24 +01:00
|
|
|
import React from 'react'
|
|
|
|
import { TypingEmulation } from './TypingEmulation'
|
|
|
|
|
|
|
|
export const SettingsContent = () => {
|
2022-01-06 09:40:56 +01:00
|
|
|
const { typebot, updateTypebot } = useTypebot()
|
2021-12-23 13:49:24 +01:00
|
|
|
|
|
|
|
const handleTypingEmulationUpdate = (
|
|
|
|
typingEmulation: TypingEmulationSettings
|
|
|
|
) => {
|
|
|
|
if (!typebot) return
|
2022-01-06 09:40:56 +01:00
|
|
|
updateTypebot({ settings: { ...typebot.settings, typingEmulation } })
|
2021-12-23 13:49:24 +01:00
|
|
|
}
|
|
|
|
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>
|
|
|
|
)
|
|
|
|
}
|