import{b as n,r as s,eN as p,eO as f,fW as m,j as z}from"./index-60a3c753.js";import{c as A,b as l}from"./index.esm-62d6b2f7.js";import{u as y}from"./index.esm-c494934a.js";import{o as g}from"./yup-92678dde.js";import{A as H}from"./NewApprovalCard-8c91325b.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};
