1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.JumpLinksItem = void 0;
|
4 | const tslib_1 = require("tslib");
|
5 | const React = tslib_1.__importStar(require("react"));
|
6 | const react_styles_1 = require("@patternfly/react-styles");
|
7 | const jump_links_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/JumpLinks/jump-links"));
|
8 | const JumpLinksList_1 = require("./JumpLinksList");
|
9 | const JumpLinksItem = (_a) => {
|
10 | var { isActive, href,
|
11 |
|
12 | node, children, onClick, className } = _a, props = tslib_1.__rest(_a, ["isActive", "href", "node", "children", "onClick", "className"]);
|
13 | const childrenArr = React.Children.toArray(children);
|
14 | const sublists = childrenArr.filter(child => child.type === JumpLinksList_1.JumpLinksList);
|
15 | children = childrenArr.filter(child => child.type !== JumpLinksList_1.JumpLinksList);
|
16 | return (React.createElement("li", Object.assign({ className: react_styles_1.css(jump_links_1.default.jumpLinksItem, isActive && jump_links_1.default.modifiers.current, className) }, (isActive && { 'aria-current': 'location' }), props),
|
17 | React.createElement("a", { className: jump_links_1.default.jumpLinksLink, href: href, onClick: onClick },
|
18 | React.createElement("span", { className: jump_links_1.default.jumpLinksLinkText }, children)),
|
19 | sublists));
|
20 | };
|
21 | exports.JumpLinksItem = JumpLinksItem;
|
22 | exports.JumpLinksItem.displayName = 'JumpLinksItem';
|
23 |
|
\ | No newline at end of file |