2
0
Files
bot/apps/builder/components/theme/ThemeContent.tsx
Baptiste Arnaud 30ddb143b4 🦴 Add theme page backbone
2021-12-23 09:37:42 +01:00

23 lines
654 B
TypeScript

import { Flex } from '@chakra-ui/react'
import { TypebotViewer } from 'bot-engine'
import { useTypebot } from 'contexts/TypebotContext'
import React, { useMemo } from 'react'
import { parseTypebotToPublicTypebot } from 'services/typebots'
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>
)
}