Debian Codegraph @

node/@patternfly/react-core/dist/js/components/Breadcrumb/BreadcrumbHeading.js

raw
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 exports.BreadcrumbHeading = void 0;
4 const tslib_1 = require("tslib");
5 const jsx_runtime_1 = require("react/jsx-runtime");
6 const react_1 = require("react");
7 const rh_microns_caret_right_icon_1 = tslib_1.__importDefault(require('@patternfly/react-icons/dist/js/icons/rh-microns-caret-right-icon'));
8 const breadcrumb_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Breadcrumb/breadcrumb"));
9 const react_styles_1 = require("@patternfly/react-styles");
10 const BreadcrumbHeading = (_a) => {
11 var { children = null, className = '', to = undefined, target = undefined, component = 'a', showDivider } = _a, props = tslib_1.__rest(_a, ["children", "className", "to", "target", "component", "showDivider"]);
12 const Component = component;
13 return ((0, jsx_runtime_1.jsxs)("li", Object.assign({}, props, { className: (0, react_styles_1.css)(breadcrumb_1.default.breadcrumbItem, className), children: [showDivider && ((0, jsx_runtime_1.jsx)("span", { className: breadcrumb_1.default.breadcrumbItemDivider, children: (0, jsx_runtime_1.jsx)(rh_microns_caret_right_icon_1.default, {}) })), (0, jsx_runtime_1.jsxs)("h1", { className: breadcrumb_1.default.breadcrumbHeading, children: [!to && component === 'button' && ((0, jsx_runtime_1.jsx)("button", { className: (0, react_styles_1.css)(breadcrumb_1.default.breadcrumbLink, breadcrumb_1.default.modifiers.current), "aria-current": true, type: "button", children: children })), to && ((0, jsx_runtime_1.jsx)(Component, { href: to, target: target, className: (0, react_styles_1.css)(breadcrumb_1.default.breadcrumbLink, breadcrumb_1.default.modifiers.current), "aria-current": "page", children: children })), !to && component !== 'button' && (0, jsx_runtime_1.jsx)(react_1.Fragment, { children: children })] })] })));
14 };
15 exports.BreadcrumbHeading = BreadcrumbHeading;
16 exports.BreadcrumbHeading.displayName = 'BreadcrumbHeading';
17 //# sourceMappingURL=BreadcrumbHeading.js.map