import{cf as p,r as h,h as x,j as e,o as a,B as f,O as j,K as b,$ as g,gC as y,z as r}from"./index-62412d73.js";const A=s=>{const{iPrId:d,source:o}=s;p(),h.useState({});const n={dominio:"",label:"Documento",name:"",tabla:"adjtip",id:"AdjTipId",type:"supercombobox",text:"AdjTipNom",where:"",whereAdicion:"",otrosCampos:"AdjTipVinc , AdjTipId",groupBy:"",ordenBy:""},{control:i,handleSubmit:c,formState:{errors:l}}=x({defaultValues:{documento:"",iPrId:d,archivo:o},mode:"onBlur"});return e("div",{children:a("form",{onSubmit:c(u=>{g.post(`${y}`,u).then(m=>{const t=m.data;t.success?(r.success("El archivo fue adjuntado correctamente"),s.handleClose(!1)):r.error(t.msg??"Error al adjuntar archivo")}).finally(()=>{})}),children:[a(f,{sx:{display:"flex",alignItems:"center",gap:"10px"},children:[e("img",{src:o,alt:"Mensaje de imagen",style:{width:"40%"}}),e("div",{style:{flexBasis:"100%"},children:e(j,{control:i,name:"documento",required:!0,iField:n,type:"supercombobox"})})]}),e(b,{sx:{marginY:"10px"},fullWidth:!0,type:"submit",disabled:Object.keys(l).length>0,children:"Adjuntar"})]})})};export{A as default};
