UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

3 lines (2 loc) 909 B
"use client"; import{jsxs as e,jsx as o}from"react/jsx-runtime";import{forwardRef as n}from"react";import t from"@mui/material/Typography";import{useTreeItemState as i}from"@mui/x-tree-view";import a from"clsx";const r="NexusAssemblyTreeItemContent",s=(n,s)=>{const{classes:c,className:d,label:l,itemId:m,icon:p,expansionIcon:x,displayIcon:f}=n,{disabled:u,expanded:h,selected:C,focused:b,handleExpansion:v,handleSelection:N,preventSelection:y}=i(m),I=p||x||f;return e("div",{className:a(d,c.root,{[c.expanded]:h,[c.selected]:C,[c.focused]:b,[c.disabled]:u},`${r}-root`),"data-testid":`${r}-root`,onMouseDown:e=>{y(e)},ref:s,children:[o("div",{onClick:e=>{v(e)},className:a(c.iconContainer,`${r}-iconContainer`),"data-testid":`${r}-iconContainer`,children:I}),o(t,{onClick:e=>{N(e)},component:"div",className:c.label,children:l})]})},c=n(s);export{c as AssemblyTreeItemContent,s as AssemblyTreeItemRenderer};