"use client";
'use strict';

var jsxRuntime = require('react/jsx-runtime');
var reactIcons_esm = require('../../node_modules/.pnpm/@radix-ui_react-icons@1.3.2_react@19.1.1/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs');
var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
var React = require('react');
var dropdownMenu = require('../dropdown-menu/dropdown-menu.cjs');
var breadcrumb_module = require('./breadcrumb.module.css.cjs');

const BreadcrumbItem = React.forwardRef(({ as, children, className, leadingIcon, current, href, dropdownItems, ...props }, ref) => {
    const renderedElement = as ?? jsxRuntime.jsx("a", { ref: ref });
    const label = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [leadingIcon && (jsxRuntime.jsx("span", { className: breadcrumb_module.default['breadcrumb-icon'], children: leadingIcon })), children && jsxRuntime.jsx("span", { children: children })] }));
    if (dropdownItems) {
        return (jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { children: [jsxRuntime.jsxs(dropdownMenu.DropdownMenu.Trigger, { className: breadcrumb_module.default['breadcrumb-dropdown-trigger'], children: [label, jsxRuntime.jsx(reactIcons_esm.ChevronDownIcon, { className: breadcrumb_module.default['breadcrumb-dropdown-icon'] })] }), jsxRuntime.jsx(dropdownMenu.DropdownMenu.Content, { className: breadcrumb_module.default['breadcrumb-dropdown-content'], children: dropdownItems.map((dropdownItem, dropdownIndex) => (jsxRuntime.jsx(dropdownMenu.DropdownMenu.Item, { className: breadcrumb_module.default['breadcrumb-dropdown-item'], onSelect: dropdownItem?.onClick, children: dropdownItem.label }, dropdownIndex))) })] }));
    }
    return (jsxRuntime.jsx("li", { className: index.cx(breadcrumb_module.default['breadcrumb-item'], className), children: React.cloneElement(renderedElement, {
            className: index.cx(breadcrumb_module.default['breadcrumb-link'], current && breadcrumb_module.default['breadcrumb-link-active']),
            href,
            ...props,
            ...renderedElement.props
        }, label) }));
});
BreadcrumbItem.displayName = 'BreadcrumbItem';

exports.BreadcrumbItem = BreadcrumbItem;
//# sourceMappingURL=breadcrumb-item.cjs.map
