diff --git a/web/app/components/workflow/features.tsx b/web/app/components/workflow/features.tsx new file mode 100644 index 0000000000..7857862de0 --- /dev/null +++ b/web/app/components/workflow/features.tsx @@ -0,0 +1,38 @@ +import { memo } from 'react' +import { useStore } from './store' +import Button from '@/app/components/base/button' +import { + Plus02, + XClose, +} from '@/app/components/base/icons/src/vender/line/general' + +const Features = () => { + const showFeatures = useStore(state => state.showFeatures) + const setShowFeatures = useStore(state => state.setShowFeatures) + + if (!showFeatures) + return null + + return ( +
+
+ Features +
+ +
+
setShowFeatures(false)} + > + +
+
+
+
+ ) +} + +export default memo(Features) diff --git a/web/app/components/workflow/header/index.tsx b/web/app/components/workflow/header/index.tsx index f8fe8336ec..0bc2f69bd6 100644 --- a/web/app/components/workflow/header/index.tsx +++ b/web/app/components/workflow/header/index.tsx @@ -1,5 +1,8 @@ import type { FC } from 'react' -import { memo } from 'react' +import { + memo, + useCallback, +} from 'react' import { useStore } from '../store' import RunAndHistory from './run-and-history' import Publish from './publish' @@ -10,6 +13,11 @@ import { ArrowNarrowLeft } from '@/app/components/base/icons/src/vender/line/arr const Header: FC = () => { const mode = useStore(state => state.mode) + const setShowFeatures = useStore(state => state.setShowFeatures) + + const handleShowFeatures = useCallback(() => { + setShowFeatures(true) + }, [setShowFeatures]) return (
{
{ mode === 'workflow' && ( - diff --git a/web/app/components/workflow/index.tsx b/web/app/components/workflow/index.tsx index 8c8752f875..585e2c248b 100644 --- a/web/app/components/workflow/index.tsx +++ b/web/app/components/workflow/index.tsx @@ -19,6 +19,7 @@ import ZoomInOut from './zoom-in-out' import CustomEdge from './custom-edge' import CustomConnectionLine from './custom-connection-line' import Panel from './panel' +import Features from './features' const nodeTypes = { custom: CustomNode, @@ -54,6 +55,7 @@ const Workflow: FC = memo(({
+ void + setShowFeatures: (showFeatures: boolean) => void } export const useStore = create(set => ({ mode: 'workflow', showRunHistory: false, setShowRunHistory: showRunHistory => set(() => ({ showRunHistory })), + showFeatures: false, + setShowFeatures: showFeatures => set(() => ({ showFeatures })), }))