diff --git a/apps/builder/pages/typebots/[typebotId]/edit.tsx b/apps/builder/pages/typebots/[typebotId]/edit.tsx index 848e411c6e..f48fb8f778 100644 --- a/apps/builder/pages/typebots/[typebotId]/edit.tsx +++ b/apps/builder/pages/typebots/[typebotId]/edit.tsx @@ -1,7 +1,11 @@ import { Flex } from '@chakra-ui/layout' import { Seo } from 'components/Seo' import { TypebotHeader } from 'components/shared/TypebotHeader' -import { EditorContext, RightPanel, useEditor } from 'contexts/EditorContext' +import { + EditorContext, + RightPanel as RightPanelEnum, + useEditor, +} from 'contexts/EditorContext' import React from 'react' import { KBar } from 'components/shared/KBar' import { BoardMenuButton } from 'components/editor/BoardMenuButton' @@ -15,7 +19,6 @@ import { GettingStartedModal } from 'components/editor/GettingStartedModal' const TypebotEditPage = () => { const { typebot, isReadOnly } = useTypebot() - const { rightPanel } = useEditor() return ( @@ -41,7 +44,7 @@ const TypebotEditPage = () => { > {typebot && } - {rightPanel === RightPanel.PREVIEW && } + @@ -50,4 +53,9 @@ const TypebotEditPage = () => { ) } +const RightPanel = () => { + const { rightPanel } = useEditor() + return rightPanel === RightPanelEnum.PREVIEW ? : <> +} + export default TypebotEditPage