import{bs as p,r as h,d as f,j as e,f as r,B as x,O as j,m as b,y,fM as g,n as a}from"./index-4e7882bc.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:l,formState:{errors:c}}=f({defaultValues:{documento:"",iPrId:d,archivo:o},mode:"onBlur"});return e("div",{children:r("form",{onSubmit:l(u=>{y.post(`${g}`,u).then(m=>{const t=m.data;t.success?(a.success("El archivo fue adjuntado correctamente"),s.handleClose(!1)):a.error(t.msg??"Error al adjuntar archivo")}).finally(()=>{})}),children:[r(x,{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(c).length>0,children:"Adjuntar"})]})})};export{A as default};
