/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import React from "react"; import { EuiButton, EuiFormRow, EuiDragDropContext, EuiDroppable, EuiSpacer, EuiText, DropResult } from "@elastic/eui"; import DraggableItem from "../../components/DraggableItem"; import EuiFormCustomLabel from "../../components/EuiFormCustomLabel"; import { Action, UIAction } from "../../../../../models/interfaces"; interface ActionsProps { actions: UIAction[]; onClickDeleteAction: (idx: number) => void; onClickEditAction: (action: UIAction) => void; onDragEndActions: (dropResult: DropResult) => void; onClickAddAction: () => void; } const Actions = ({ actions, onClickDeleteAction, onClickEditAction, onDragEndActions, onClickAddAction }: ActionsProps) => { return ( <> {!!actions.length && ( {actions.map((action, idx) => ( onClickDeleteAction(idx)} onClickEdit={() => onClickEditAction(action)} draggableType="action" /> ))} )} {!actions.length && (

No actions have been added.

)} + Add action ); }; export default Actions;