"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = HeaderBreadcrumbs;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const React = tslib_1.__importStar(require("react"));
const hooks_1 = require("../../gravity-blocks/hooks/index.js");
const models_1 = require("../../models/index.js");
const utils_1 = require("../../utils/index.js");
const i18n_1 = require("./i18n/index.js");
const b = (0, utils_1.block)('header-breadcrumbs');
function HeaderBreadcrumbs(props) {
    const { items, theme = 'light', className, analyticsEvents } = props;
    const handleAnalytics = (0, hooks_1.useAnalytics)(models_1.DefaultEventNames.Breadcrumb);
    const onClick = React.useCallback(() => {
        handleAnalytics(analyticsEvents);
    }, [analyticsEvents, handleAnalytics]);
    return ((0, jsx_runtime_1.jsx)("nav", { className: b({ theme }, className), "aria-label": (0, i18n_1.i18n)('label'), children: (0, jsx_runtime_1.jsx)("ol", { className: b('list'), children: items?.map(({ url, text }) => ((0, jsx_runtime_1.jsxs)("li", { className: b('item'), children: [(0, jsx_runtime_1.jsx)("a", { href: url, className: b('text'), onClick: onClick, children: text }), (0, jsx_runtime_1.jsx)("span", { className: b('separator'), "aria-hidden": true, children: "/" })] }, url))) }) }));
}
//# sourceMappingURL=HeaderBreadcrumbs.js.map
