/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import { EuiButton, EuiComboBox, EuiComboBoxOptionOption, EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect, EuiSelectOption, EuiSpacer, } from "@elastic/eui"; import { CreateRepositorySettings } from "../../../../../server/models/interfaces"; import React from "react"; import { IndexItem } from "../../../../../models/interfaces"; import CustomLabel from "../../../../components/CustomLabel"; import { SnapshotManagementService } from "../../../../services"; import CreateRepositoryFlyout from "../../../Repositories/components/CreateRepositoryFlyout/CreateRepositoryFlyout"; interface SnapshotIndicesProps { indexOptions: EuiComboBoxOptionOption[]; selectedIndexOptions: EuiComboBoxOptionOption[]; onIndicesSelectionChange: (selectedOptions: EuiComboBoxOptionOption[]) => void; getIndexOptions: (searchValue: string) => void; onCreateOption: (searchValue: string, options: Array>) => void; repoOptions: EuiSelectOption[]; selectedRepoValue: string; onRepoSelectionChange: (e: React.ChangeEvent) => void; // create repository flyout showFlyout?: boolean; openFlyout?: () => void; closeFlyout?: () => void; createRepo?: (repoName: string, type: string, settings: CreateRepositorySettings) => void; snapshotManagementService?: SnapshotManagementService; repoError: string; } const SnapshotIndicesRepoInput = ({ indexOptions, selectedIndexOptions, onIndicesSelectionChange, getIndexOptions, onCreateOption, repoOptions, selectedRepoValue, onRepoSelectionChange, showFlyout, openFlyout, closeFlyout, createRepo, snapshotManagementService, repoError, }: SnapshotIndicesProps) => { let createRepoFlyout; if (snapshotManagementService != null && createRepo != null && closeFlyout != null) { createRepoFlyout = ( ); } return ( <> {showFlyout != null && ( Create repository )} {showFlyout && createRepoFlyout} ); }; export default SnapshotIndicesRepoInput;