feat(editor): ✨ Start preview from any block
This commit is contained in:
@ -13,18 +13,23 @@ export enum RightPanel {
|
||||
const editorContext = createContext<{
|
||||
rightPanel?: RightPanel
|
||||
setRightPanel: Dispatch<SetStateAction<RightPanel | undefined>>
|
||||
startPreviewAtBlock: string | undefined
|
||||
setStartPreviewAtBlock: Dispatch<SetStateAction<string | undefined>>
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
//@ts-ignore
|
||||
}>({})
|
||||
|
||||
export const EditorContext = ({ children }: { children: ReactNode }) => {
|
||||
const [rightPanel, setRightPanel] = useState<RightPanel>()
|
||||
const [startPreviewAtBlock, setStartPreviewAtBlock] = useState<string>()
|
||||
|
||||
return (
|
||||
<editorContext.Provider
|
||||
value={{
|
||||
rightPanel,
|
||||
setRightPanel,
|
||||
startPreviewAtBlock,
|
||||
setStartPreviewAtBlock,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
@ -440,9 +440,11 @@ const useLinkedTypebots = ({
|
||||
},
|
||||
Error
|
||||
>(
|
||||
typebotIds?.every((id) => typebotId === id)
|
||||
? undefined
|
||||
: `/api/typebots?${params}`,
|
||||
workspaceId
|
||||
? typebotIds?.every((id) => typebotId === id)
|
||||
? undefined
|
||||
: `/api/typebots?${params}`
|
||||
: null,
|
||||
fetcher
|
||||
)
|
||||
if (error) onError(error)
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
useEffect,
|
||||
useState,
|
||||
} from 'react'
|
||||
import { byId } from 'utils'
|
||||
import { byId, isNotEmpty } from 'utils'
|
||||
import { MemberInWorkspace, Plan, Workspace, WorkspaceRole } from 'db'
|
||||
import {
|
||||
createNewWorkspace,
|
||||
|
Reference in New Issue
Block a user