/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import React from 'react'; import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { ModalConsumer } from '../Modal'; interface ContentPanelActionsProps { actions: { text: string; buttonProps?: object; flexItemProps?: object; modal?: { onClickModal: (onShow: (component: any, props: object) => void) => () => void; }; }[]; } const ContentPanelActions: React.SFC = ({ actions }) => ( {actions.map(({ text, buttonProps = {}, flexItemProps = {}, modal = null }, index) => { let button = ( {text} ); if (modal) { button = ( {({ onShow }) => ( {text} )} ); } return ( {button} ); })} ); export default ContentPanelActions;