/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import { EuiFieldText, EuiFormRow } from '@elastic/eui'; import React, { useContext } from 'react'; import { CreateChannelContext } from '../CreateChannel'; import { validateWebhookURL } from '../utils/validationHelper'; interface ChimeSettingsProps { chimeWebhook: string; setChimeWebhook: (url: string) => void; } export function ChimeSettings(props: ChimeSettingsProps) { const context = useContext(CreateChannelContext)!; return ( 0} > props.setChimeWebhook(e.target.value)} isInvalid={context.inputErrors.chimeWebhook.length > 0} onBlur={() => { context.setInputErrors({ ...context.inputErrors, chimeWebhook: validateWebhookURL(props.chimeWebhook), }); }} /> ); }