From a51c43c5005aced2a998672345d0aec8bb136d31 Mon Sep 17 00:00:00 2001 From: Robert Date: Sat, 9 Mar 2024 04:48:50 +0700 Subject: [PATCH] display actions --- src/widgets/action-editor/ui/ActionEditor.tsx | 16 +++- src/widgets/chain-editor/ui/ChainEditor.tsx | 92 ++++++++++++++++--- 2 files changed, 94 insertions(+), 14 deletions(-) diff --git a/src/widgets/action-editor/ui/ActionEditor.tsx b/src/widgets/action-editor/ui/ActionEditor.tsx index fe1b1a7..eebd572 100644 --- a/src/widgets/action-editor/ui/ActionEditor.tsx +++ b/src/widgets/action-editor/ui/ActionEditor.tsx @@ -45,12 +45,16 @@ interface ActionEditorProps { actionIndex?: number; initialAction?: CommentAction; onSave?: (actionIndex: number, action: CommentAction) => Promise | void; + onClose?: () => Promise | void; + canExit?: boolean; } export default function ActionEditor({ actionIndex = 0, initialAction, onSave, + onClose, + canExit = false, }: ActionEditorProps) { const [value, setValue] = useState(0); @@ -117,7 +121,17 @@ export default function ActionEditor({ -
+
+ {canExit && ( + + )} +
+ ); + })} + +
+ +
);