import React, { useMemo, memo } from 'react';
import i18n from 'ui-i18n';
import { isAvailableEntityType } from '@reltio/mdm-sdk';
import { MetadataTypesSelector } from '../MetadataTypesSelector';
export var EntityTypesSelector = memo(function (_a) {
    var entityTypes = _a.entityTypes, selectedEntityTypes = _a.selectedEntityTypes, single = _a.single, placeholder = _a.placeholder, enableEmptyValueUnderline = _a.enableEmptyValueUnderline, onChange = _a.onChange, _b = _a.classes, classes = _b === void 0 ? {} : _b, _c = _a.ListLabelProps, ListLabelProps = _c === void 0 ? {} : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d;
    var items = useMemo(function () { return entityTypes.filter(isAvailableEntityType); }, [entityTypes]);
    return (React.createElement(MetadataTypesSelector, { items: items, selectedItemsUris: selectedEntityTypes, single: single, placeholder: placeholder, enableEmptyValueUnderline: enableEmptyValueUnderline, onChange: onChange, classes: classes, ListLabelProps: ListLabelProps, disabled: disabled, label: i18n.text('Entity type'), dataReltioId: "entity-type-selector", selectionPopupTitle: i18n.text('Select entity types') }));
});
EntityTypesSelector.displayName = 'EntityTypesSelector';
