@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
28 lines • 808 B
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
const _excluded = ["className"];
import React from 'react';
import classnames from 'classnames';
import E from '../Element';
import Ul from './Ul';
import Ol from './Ol';
const Li = (_ref = {}) => {
let {
className
} = _ref,
props = _objectWithoutProperties(_ref, _excluded);
if (Array.isArray(props.children)) {
props.children.forEach(Comp => {
if (Comp && (Comp.type === Ul || Comp.type === Ol)) {
className = classnames(className, 'is-nested');
}
});
}
return React.createElement(E, _extends({
as: "li"
}, props, {
className: className
}));
};
export default Li;
//# sourceMappingURL=Li.js.map