2021-12-23 09:37:42 +01:00
|
|
|
import { Flex } from '@chakra-ui/react'
|
|
|
|
import { TypebotViewer } from 'bot-engine'
|
|
|
|
import { useTypebot } from 'contexts/TypebotContext'
|
|
|
|
import React, { useMemo } from 'react'
|
2021-12-23 16:31:56 +01:00
|
|
|
import { parseTypebotToPublicTypebot } from 'services/publicTypebot'
|
2021-12-23 09:37:42 +01:00
|
|
|
import { SideMenu } from './SideMenu'
|
|
|
|
|
|
|
|
export const ThemeContent = () => {
|
|
|
|
const { typebot } = useTypebot()
|
|
|
|
const publicTypebot = useMemo(
|
|
|
|
() => (typebot ? parseTypebotToPublicTypebot(typebot) : undefined),
|
|
|
|
[typebot]
|
|
|
|
)
|
|
|
|
return (
|
|
|
|
<Flex h="full" w="full">
|
|
|
|
<SideMenu />
|
|
|
|
<Flex flex="1">
|
|
|
|
{publicTypebot && <TypebotViewer typebot={publicTypebot} />}
|
|
|
|
</Flex>
|
|
|
|
</Flex>
|
|
|
|
)
|
|
|
|
}
|