@flanksource/clicky-ui
Version:
Flanksource Clicky UI — React component library built on shadcn/ui with light/dark and density theming.
42 lines (41 loc) • 1.16 kB
JavaScript
import { jsxs, jsx } from "react/jsx-runtime";
import { cn } from "../lib/utils.js";
import { Icon } from "./Icon.js";
function TreeGroupHeader({
title,
open,
onToggle,
icon,
count,
className
}) {
return /* @__PURE__ */ jsxs(
"button",
{
type: "button",
onClick: onToggle,
"aria-expanded": open,
className: cn(
"w-full flex items-center gap-2 px-3 py-2 border-b border-border select-none",
"hover:bg-accent transition-colors text-left",
className
),
children: [
/* @__PURE__ */ jsx(
Icon,
{
name: open ? "codicon:chevron-down" : "codicon:chevron-right",
className: "text-muted-foreground text-xs"
}
),
icon && /* @__PURE__ */ jsx(Icon, { name: icon, className: "text-base" }),
/* @__PURE__ */ jsx("span", { className: "font-medium text-sm flex-1 truncate", children: title }),
count !== void 0 && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: count })
]
}
);
}
export {
TreeGroupHeader
};
//# sourceMappingURL=TreeGroupHeader.js.map