'use client';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SidebarItem = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const navigation_1 = require("next/navigation");
const sidebar_item_button_1 = require("./sidebar-item-button");
const sidebar_item_icon_button_1 = require("./sidebar-item-icon-button");
const sidebar_provider_1 = require("./sidebar-provider");
const SidebarItem = ({ active, href, children: _children, ...props }) => {
    const pathname = (0, navigation_1.usePathname)();
    const { isCollapsed } = (0, sidebar_provider_1.useSidebar)();
    const isActive = (href) => pathname === href;
    if (isCollapsed) {
        return ((0, jsx_runtime_1.jsx)(sidebar_item_icon_button_1.SidebarItemIconButton, { "data-slot": "sidebar-item", href: href, active: isActive(href) || active, ...props }));
    }
    return ((0, jsx_runtime_1.jsx)(sidebar_item_button_1.SidebarItemButton, { "data-slot": "sidebar-item", href: href, active: isActive(href) || active, ...props }));
};
exports.SidebarItem = SidebarItem;
