import React, { useContext, useState } from 'react';
import { translate as __ } from 'foremanReact/common/I18n';
import { FormattedMessage } from 'react-intl';
import { TreeView, Button, Text, TextContent, TextVariants, Flex, FlexItem, Dropdown, DropdownItem, DropdownToggle } from '@patternfly/react-core';
import { useWizardContext } from '@patternfly/react-core/next';
import { CaretDownIcon } from '@patternfly/react-icons';
import { BulkPackagesWizardContext, UPGRADE_ALL, INSTALL, REMOVE, UPGRADE } from './BulkPackagesWizard';
export const dropdownOptions = [
__('via remote execution'),
__('via customized remote execution'),
];
export const BulkPackagesReview = () => {
const { goToStepById } = useWizardContext();
const {
selectedAction,
finishButtonText,
selectedRexOption,
setSelectedRexOption,
finishButtonLoading,
packagesBulkSelect: {
selectedResults: selectedPackageResults,
selectedCount: currentSelectedPackagesCount,
},
hostsBulkSelect: {
selectedCount: currentSelectedHostsCount,
},
} = useContext(BulkPackagesWizardContext);
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
const toggleDropdownOpen = () => setIsDropdownOpen(prev => !prev);
const handleSelect = () => {
setIsDropdownOpen(false);
};
const dropdownItems = dropdownOptions.map(text => (