import{f as g,D as j,r as i,q as w,c as A,j as o,I as b,B as k,g2 as C}from"./index-7d3dbb9c.js";import{A as S}from"./index-09ed9bd1.js";import{T as v}from"./Tooltip-d767de94.js";import{C as y}from"./ChecklistRtl-ab3abf2c.js";const z=g(j)(({theme:r})=>({"& .MuiDrawer-paper":{borderRadius:"12px 0 0 12px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",backgroundColor:r.palette.background.default,color:r.palette.text.primary}})),E=({selectedData:r,instance_id:e,callback:l,app_label:c,model_name:u,customButton:a,isDisabled:x})=>{const[s,t]=i.useState(!1),h=w(),d=A(),f=()=>{t(!1),d(C())};i.useRef(!1);const n=r==null?void 0:r.authorized_status,m=n===2||n===4;return o.jsxs(o.Fragment,{children:[a?o.jsx("span",{style:{display:"inline-block"},onClick:p=>{if(x){p.preventDefault(),p.stopPropagation();return}t(!s)},children:a}):o.jsx(v,{title:s?"":"Authorization",arrow:!0,placement:"top",children:o.jsx(b,{sx:{ml:1},children:o.jsx(y,{sx:{color:"green"},onClick:()=>t(!s)})})}),o.jsx(z,{anchor:"right",open:s,onClose:f,children:o.jsx(k,{sx:{width:400,p:3,bgcolor:h.palette.background.paper},children:s&&o.jsx(S,{data:r,app_label:c,model_name:u,instance_id:e||"",callback:l,disableActions:m,curentAthorizationStatus:r==null?void 0:r.current_authorized_status_name})})})]})};export{E as A};
