import type { FC, ReactElement, } from 'react' import { cloneElement, memo, useCallback, } from 'react' import type { SelectedNode } from '../../types' import BlockIcon from '../../block-icon' import { useWorkflow } from '../../hooks' import NextStep from './components/next-step' import { DescriptionInput, TitleInput, } from './components/title-description-input' import { DotsHorizontal, XClose, } from '@/app/components/base/icons/src/vender/line/general' import { GitBranch01 } from '@/app/components/base/icons/src/vender/line/development' type BasePanelProps = { children: ReactElement } & SelectedNode const BasePanel: FC = ({ id, data, children, }) => { const { handleSelectNode, handleUpdateNodeData, } = useWorkflow() const handleTitleChange = useCallback((title: string) => { handleUpdateNodeData({ id, data: { ...data, title } }) }, [handleUpdateNodeData, id, data]) const handleDescriptionChange = useCallback((desc: string) => { handleUpdateNodeData({ id, data: { ...data, desc } }) }, [handleUpdateNodeData, id, data]) return (
handleSelectNode({ id, data }, true)} >
{cloneElement(children, { id, data })}
NEXT STEP
Add the next block in this workflow
) } export default memo(BasePanel)