import{ci as p,r as h,h as x,j as e,o as a,B as j,O as f,K as b,$ as g,gL as y,z as r}from"./index-e717fda1.js";const A=s=>{const{iPrId:n,source:o}=s;p(),h.useState({});const d={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:n,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(j,{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(f,{control:i,name:"documento",required:!0,iField:d,type:"supercombobox"})})]}),e(b,{sx:{marginY:"10px"},fullWidth:!0,type:"submit",disabled:Object.keys(l).length>0,children:"Adjuntar"})]})})};export{A as default};
