import { type FC, useEffect } from 'react' import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext' import { useSelectOrDelete } from '../../hooks' import { DELETE_LAST_RUN_COMMAND, LastRunBlockNode } from '.' import cn from '@/utils/classnames' import { Variable02 } from '../../../icons/src/vender/solid/development' type Props = { nodeKey: string } const LastRunBlockComponent: FC = ({ nodeKey, }) => { const [editor] = useLexicalComposerContext() const [ref, isSelected] = useSelectOrDelete(nodeKey, DELETE_LAST_RUN_COMMAND) useEffect(() => { if (!editor.hasNodes([LastRunBlockNode])) throw new Error('WorkflowVariableBlockPlugin: WorkflowVariableBlock not registered on editor') }, [editor]) return (
{ e.stopPropagation() }} ref={ref} >
last_run
) } export default LastRunBlockComponent