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.

2 lines (1 loc) 914 B
import{jsx as o}from"react/jsx-runtime";import i from"@mui/material/Button";import r from"@mui/material/Box";import e from"@mui/material/Typography";import t from"@mui/icons-material/ArrowDropDown";import n from"@mui/icons-material/ArrowDropUp";import m from"@mui/material/Tooltip";const p=p=>{const{open:s,permission:a,onClick:l,disabled:d,disabledMessage:f,sx:c,...u}=p;return o(m,{PopperProps:{popperOptions:{modifiers:[{name:"offset",options:{offset:[0,-10]}}]}},title:f||a?.description,placement:"left",arrow:!0,children:o(r,{component:"span",children:o(i,{"data-testid":"NexusPermissionButton-root",endIcon:o(s?n:t,{}),onClick:l,disabled:d,sx:[{maxWidth:a?.description?190:130},...Array.isArray(c)?c:[c]],...u,children:o(e,{sx:{fontSize:12,fontWeight:700,lineHeight:1.6,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",textAlign:"left"},children:a?.label})})})})};export{p as PermissionButton};