import React from 'react';
import PropTypes from 'prop-types';
import { Chip, ChipGroup, Button } from '@patternfly/react-core';
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
import { hostMethods } from '../../JobWizardConstants';
const SelectedChip = ({ selected, setSelected, categoryName }) => {
const deleteItem = itemToRemove => {
setSelected(oldSelected =>
oldSelected.filter(({ id }) => id !== itemToRemove)
);
};
const NUM_CHIPS = 3;
return (
<>
}
>
);
};
export const SelectedChips = ({
selectedHosts,
setSelectedHosts,
selectedHostCollections,
setSelectedHostCollections,
selectedHostGroups,
setSelectedHostGroups,
hostsSearchQuery,
clearSearch,
}) => {
const clearAll = () => {
setSelectedHosts(() => []);
setSelectedHostCollections(() => []);
setSelectedHostGroups(() => []);
clearSearch();
};
const showClear =
selectedHosts.length ||
selectedHostCollections.length ||
selectedHostGroups.length ||
hostsSearchQuery;
return (