2
0
Files
bot/apps/builder/layouts/theme/ThemeContent.tsx

24 lines
762 B
TypeScript
Raw Normal View History

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