import React, { useMemo, memo } from 'react';
import i18n from 'ui-i18n';
import { isAvailableRelationType } from '@reltio/mdm-sdk';
import { MetadataTypesSelector } from '../MetadataTypesSelector';
export var RelationTypesSelector = memo(function (_a) {
    var relationTypes = _a.relationTypes, selectedRelationTypes = _a.selectedRelationTypes, 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 relationTypes.filter(isAvailableRelationType); }, [relationTypes]);
    return (React.createElement(MetadataTypesSelector, { items: items, selectedItemsUris: selectedRelationTypes, single: single, placeholder: placeholder, enableEmptyValueUnderline: enableEmptyValueUnderline, onChange: onChange, classes: classes, ListLabelProps: ListLabelProps, disabled: disabled, label: i18n.text('Relation type'), dataReltioId: "relation-type-selector", selectionPopupTitle: i18n.text('Select relation types') }));
});
RelationTypesSelector.displayName = 'RelationTypesSelector';
