@yandex/ui
Version:
Yandex UI components
19 lines (18 loc) • 816 B
JavaScript
import { __assign, __rest } from "tslib";
import React from 'react';
import { getDisplayName } from '../../lib/getDisplayName';
import { useCollection } from '../../useCollection';
/**
* Модификатор, отвечающий за содержимое меню.
*/
export function withJsxContent(WrappedComponent) {
var WithJsxContent = function (props) {
var items = props.items, children = props.children, otherProps = __rest(props, ["items", "children"]);
var collection = useCollection(props);
return React.createElement(WrappedComponent, __assign({}, otherProps, { items: items || collection }));
};
WithJsxContent.displayName = "withJsxContent(" + getDisplayName(WrappedComponent) + ")";
return WithJsxContent;
}
export * from './Group';
export * from './Item';