Introduce bot v2 in builder (#328)

Also, the new engine is the default for updated typebots for viewer

Closes #211
This commit is contained in:
Baptiste Arnaud
2023-02-21 15:25:14 +01:00
committed by GitHub
parent 527dc8a5b1
commit debdac12ff
208 changed files with 4462 additions and 5236 deletions

View File

@@ -1,19 +1,12 @@
import { Seo } from '@/components/Seo'
import { TypebotHeader, useTypebot } from '@/features/editor'
import { Flex } from '@chakra-ui/react'
import { TypebotViewer } from 'bot-engine'
import { useMemo } from 'react'
import { Standard } from '@typebot.io/react'
import { getViewerUrl } from 'utils'
import { SettingsSideMenu } from './SettingsSideMenu'
import { parseTypebotToPublicTypebot } from '@/features/publish'
export const SettingsPage = () => {
const { typebot } = useTypebot()
const publicTypebot = useMemo(
() => (typebot ? parseTypebotToPublicTypebot(typebot) : undefined),
// eslint-disable-next-line react-hooks/exhaustive-deps
[typebot?.settings]
)
return (
<Flex overflow="hidden" h="100vh" flexDir="column">
@@ -21,10 +14,8 @@ export const SettingsPage = () => {
<TypebotHeader />
<Flex h="full" w="full">
<SettingsSideMenu />
<Flex flex="1" overflow="hidden">
{publicTypebot && (
<TypebotViewer apiHost={getViewerUrl()} typebot={publicTypebot} />
)}
<Flex flex="1">
{typebot && <Standard apiHost={getViewerUrl()} typebot={typebot} />}
</Flex>
</Flex>
</Flex>