2
0

🦴 Add settings page backbone

This commit is contained in:
Baptiste Arnaud
2021-12-23 13:49:24 +01:00
parent 4d8056dfe8
commit 79aede1f3f
14 changed files with 238 additions and 12 deletions

View File

@ -0,0 +1,26 @@
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>
)
}