import{__assign as e}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{ChevronDown as t,RadioTower as r,FolderOpen as c}from"lucide-react";import i from"../../styles/ScopeTree.module.css.js";import{TreeMenu as a}from"./TreeMenu.js";import{HighlightedText as d}from"./HighlightedText.js";var s=function(s){var l=s.name,m=s.isExpanded,p=s.isSelected,u=s.isAncestor,h=s.isExpandable,v=void 0===h||h,f=s.onToggleExpand,g=s.onClick,x=s.menuOptions,b=s.searchQuery,k=s.childrenCount,C=s.nodeType,N=p?i.nodeHeaderSelected:u?i.nodeHeaderAncestor:"",y=p||u;return o("div",e({className:"".concat(i.nodeHeader," ").concat(N),onClick:g,role:"button",tabIndex:0,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),g())}},{children:[n("div",e({className:"".concat(i.chevron," ").concat(m?i.chevronExpanded:""," ").concat(v?"":i.chevronHidden),onClick:function(e){v&&f(e)},role:"button",tabIndex:v?0:-1},{children:n(t,{size:16,strokeWidth:y?2.5:2,color:y?"#2563EB":"#64748B"})})),n("div",e({className:i.folderIcon},{children:"station"===(null==C?void 0:C.toLocaleLowerCase())?n(r,{size:18,strokeWidth:y?2.5:2,color:y?"currentColor":"#64748B"}):n(c,{size:18,strokeWidth:y?2.5:2,color:y?"currentColor":"#64748B"})})),n("span",e({className:i.nodeName},{children:n(d,{text:l,highlight:b})})),void 0!==k&&k>0&&n("span",e({className:"".concat(i.badge," ").concat(p?i.badgeActive:"")},{children:k})),x&&x.length>0&&n("div",e({onClick:function(e){return e.stopPropagation()}},{children:n(a,{options:x,buttonClassName:i.optionsButton,iconSize:16})}))]}))};export{s as TreeNodeHeader};
//# sourceMappingURL=TreeNodeHeader.js.map
