import{f as j,D as w,r as c,q as C,c as b,j as o,I as k,B as z,g3 as S}from"./index-55b8aeb0.js";import{A as v}from"./index-7e195410.js";import{T as y}from"./Tooltip-55c3c911.js";import{C as _}from"./ChecklistRtl-b208d0a0.js";const R=j(w)(({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}})),M=({selectedData:r,instance_id:u,callback:h,app_label:x,model_name:d,customButton:t,isDisabled:a,onDrawerOpen:n})=>{const[s,i]=c.useState(!1),f=C(),m=b(),g=()=>{i(!1),m(S())},p=()=>{a||(n&&n(),i(!s))};c.useRef(!1);const e=r==null?void 0:r.authorized_status,A=e===2||e===4;return o.jsxs(o.Fragment,{children:[t?o.jsx("span",{style:{display:"inline-block"},onClick:l=>{if(a){l.preventDefault(),l.stopPropagation();return}p()},children:t}):o.jsx(y,{title:s?"Close Authorization":"Authorization",arrow:!0,placement:"top",children:o.jsx(k,{sx:{ml:1},onClick:p,children:o.jsx(_,{sx:{color:"green"}})})}),o.jsx(R,{anchor:"right",open:s,onClose:g,children:o.jsx(z,{sx:{width:400,p:3,bgcolor:f.palette.background.paper},children:s&&o.jsx(v,{data:r,app_label:x,model_name:d,instance_id:u||"",callback:h,disableActions:A,curentAthorizationStatus:r==null?void 0:r.current_authorized_status_name})})})]})};export{M as A};
