/* * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * * Modifications Copyright OpenSearch Contributors. See * GitHub history for details. */ import { EuiFlexItem, EuiFlexGroup, EuiText, EuiLink, EuiTitle, EuiFieldText, EuiCallOut, EuiSpacer, EuiFormRow, EuiCheckbox, EuiIcon, } from '@elastic/eui'; import { Field, FieldProps } from 'formik'; import React, { useState } from 'react'; import ContentPanel from '../../../../components/ContentPanel/ContentPanel'; import { CUSTOM_AD_RESULT_INDEX_PREFIX } from '../../../../../server/utils/constants'; import { BASE_DOCS_LINK } from '../../../../utils/constants'; import { isInvalid, getError, validateCustomResultIndex, } from '../../../../utils/utils'; interface CustomResultIndexProps { isEdit: boolean; useDefaultResultIndex?: boolean; resultIndex?: string; } function CustomResultIndex(props: CustomResultIndexProps) { const [enabled, setEnabled] = useState(!!props.resultIndex); return (

Custom result index

} subTitle={ Store detector results to your own index.{' '} Learn more } > {({ field, form }: FieldProps) => ( { if (enabled) { form.setFieldValue('resultIndex', ''); } setEnabled(!enabled); }} /> {enabled ? ( ) : null} {enabled ? ( ) : null} )}
); } export default CustomResultIndex;