import{b as n,r as s,eN as p,eO as f,fW as m,j as z}from"./index-43bf7a1c.js";import{c as A,b as l}from"./index.esm-f9e0a906.js";import{u as y}from"./index.esm-0548c843.js";import{o as g}from"./yup-3b80ed10.js";import{A as H}from"./NewApprovalCard-66a208ab.js";const q=({data:a,app_label:t,model_name:r,instance_id:o,callback:c,timelineContainerHeight:k="calc(100vh - 300px)"})=>{const i=n();s.useState(!1),s.useState(!1);const{authorization:{authorizationHistory:x,authorizationHistoryCount:C,authorizationHistoryLoading:j,authorizationHistoryParams:u,checkAuthorization:v,checkAuthorizationLoading:E,authorizationPostLoading:L},system:{userAccessList:P}}=p(),e=`${t}.${r}`;s.useEffect(()=>{t&&r&&o?i(f({app_label:t,model_name:r,instance_id:o,obj:{instance_id:o},callback:()=>{}})):console.error("postCheckAuthorization 'no: app_label && model_name && instance_id'")},[t,r,o]);const h=A().shape({description:l().required("Please enter your description").trim()});return y({resolver:g(h)}),s.useEffect(()=>{e&&o?i(m({model_path:e,instance_id:o,params:u})):console.error("getAuthorizationHistory 'no: model_path && instance_id'")},[e,o]),z.jsx(H,{data:a,app_label:t,model_name:r,instance_id:o||"",callback:c})};export{q as A};
