/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import React, { ChangeEvent } from "react"; import { EuiSpacer, EuiFormRow, EuiTextArea, EuiSelect, EuiButton, EuiFlexGroup, EuiFlexItem } from "@elastic/eui"; import "brace/theme/github"; import "brace/mode/json"; import { FeatureChannelList } from "../../../server/models/interfaces"; import CustomFormRow from "../CustomFormRow"; interface ChannelNotificationProps { channelId: string; channels: FeatureChannelList[]; loadingChannels: boolean; message?: string; onChangeChannelId: (value: ChangeEvent) => void; onChangeMessage?: (value: ChangeEvent) => void; getChannels: () => void; actionNotification?: boolean; // to tell if this is rendering in actions or in error notification as they both show up on page together } const ChannelNotification = ({ channelId, channels, loadingChannels, message, onChangeChannelId, onChangeMessage, getChannels, actionNotification = false, }: ChannelNotificationProps) => { return ( <> ({ value: channel.config_id, text: channel.name }))} value={channelId} onChange={onChangeChannelId} data-test-subj={actionNotification ? "create-policy-notification-action-channel-id" : "create-policy-notification-channel-id"} /> Manage channels {!!channelId && ( <> )} ); }; export default ChannelNotification;