import{N as j,j as R}from"./index-D0o5GN6H.js";const p=({permission:e,module:r,action:l,role:a,requireAll:n=!1,hide:o=!1,disabled:f=!0,disabledText:c="No Permission",children:u,buttonProps:P={},...h})=>{const{hasPermission:m,hasAnyPermission:A,hasAllPermissions:y,hasModulePermission:d,hasRole:x,hasAnyRole:b}=j();let s=!1;if(r&&l?s=d(r,l):e?Array.isArray(e)?s=n?y(e):A(e):s=m(e):a?Array.isArray(a)?s=b(a):s=x(a):s=!1,o&&!s)return null;const t=!s&&f,N=t?c:u,i={disabled:t,...P,...h};return t&&(i.className=`${i.className||""} opacity-50 cursor-not-allowed`.trim()),R.jsx("button",{...i,children:N})};export{p as P};
