// @bun
// src/components/shell/WorkspaceSidebar.tsx
import { Settings } from "lucide-react";
import {
  Sidebar,
  SidebarContent,
  SidebarFooter,
  SidebarHeader,
  SidebarMenu,
  SidebarMenuButton,
  SidebarMenuItem,
  SidebarRail
} from "@contractspec/lib.ui-kit-web/ui/sidebar";
import { jsx, jsxs } from "react/jsx-runtime";
function WorkspaceSidebar({
  modules,
  activeModuleId,
  onModuleChange,
  sidebarFooter
}) {
  return /* @__PURE__ */ jsxs(Sidebar, {
    children: [
      /* @__PURE__ */ jsx(SidebarRail, {}),
      /* @__PURE__ */ jsx(SidebarHeader, {}),
      /* @__PURE__ */ jsx(SidebarContent, {
        children: /* @__PURE__ */ jsxs(SidebarMenu, {
          children: [
            modules.map((m) => /* @__PURE__ */ jsx(SidebarMenuItem, {
              children: /* @__PURE__ */ jsxs(SidebarMenuButton, {
                isActive: m.id === activeModuleId,
                onClick: () => onModuleChange(m.id),
                children: [
                  m.icon,
                  /* @__PURE__ */ jsx("span", {
                    children: m.label
                  }),
                  m.badge != null ? /* @__PURE__ */ jsx("span", {
                    className: "text-muted-foreground ml-auto text-xs",
                    children: String(m.badge)
                  }) : null
                ]
              })
            }, m.id)),
            /* @__PURE__ */ jsx(SidebarMenuItem, {
              children: /* @__PURE__ */ jsxs(SidebarMenuButton, {
                isActive: activeModuleId === "settings",
                onClick: () => onModuleChange("settings"),
                children: [
                  /* @__PURE__ */ jsx(Settings, {
                    className: "size-4"
                  }),
                  /* @__PURE__ */ jsx("span", {
                    children: "Settings"
                  })
                ]
              })
            })
          ]
        })
      }),
      /* @__PURE__ */ jsx(SidebarFooter, {
        children: sidebarFooter
      })
    ]
  });
}
export {
  WorkspaceSidebar
};
