import{y as u,u as h,j as r,N as f,r as i,B as t,f as n,m as x,F as g,L as F,q as y,n as b}from"./index-ca24af84.js";import{D as L}from"./Divider-21330109.js";import{a as C}from"./abrirPDF-eff5ea84.js";import{L as w,d as D}from"./Loader-d02a9406.js";import{b as T,p as A}from"./env-198ff0f3.js";import{C as S}from"./Container-30ca10cd.js";import{T as d}from"./Typography-bfd9c243.js";import{L as j}from"./ListItemIcon-2dd9a578.js";import{L as v}from"./ListItemText-eb0972a7.js";import"./dividerClasses-fa4eeeba.js";import"./createContainer-b0287129.js";import"./useThemeProps-95e03d4e.js";import"./toPropertyKey-4015efc6.js";import"./useSlot-32c61900.js";import"./listItemTextClasses-9e4a600e.js";const k=async a=>{const{data:s}=await u.post(`${T}/${A}/rest/firma/docsFirmados`,{idFirma:a});return s},_=()=>{const{authFirma:a,unAuthenticateSignature:s}=h();if(!a)return r(f,{to:"/firma-verificar"});const[m,p]=i.useState([]),[l,c]=i.useState(!0);return i.useEffect(()=>{const e=JSON.parse(localStorage.getItem("authFirma"));(async()=>{c(!0);try{const o=await k(e.idFirma);o.success?p(o.documentos):o.success||b.error(o.msg)}catch{}finally{c(!1)}})()},[]),r(t,{sx:{backgroundColor:"#F4F5FA",height:"100dvh"},children:r(S,{maxWidth:"xl",children:n(t,{children:[r(t,{width:"100%",display:"flex",justifyContent:"right",children:r(x,{sx:{marginTop:"1em"},variant:"contained",size:"small",onClick:s,children:"Salir"})}),n(t,{width:"100%",sx:{paddingTop:"2em",display:"flex"},children:[r(t,{display:"flex",justifyContent:"space-between",flexDirection:"row",children:r(d,{level:"h1",gutterBottom:!0,component:"h1",children:"Documentos firmados"})}),r(L,{})]}),r(t,{width:"100%",sx:{marginTop:"1em"},children:l?r(w,{}):r(g,{children:m.length?r(F,{sx:{backgroundColor:"#FFF",padding:"0.5em",borderRadius:"2px",boxShadow:"rgba(149, 157, 165, 0.2) 0px 8px 24px"},children:m.map(e=>n(y,{sx:{borderRadius:"2px",backgroundColor:"#FAFAF9",marginY:"0.5em"},secondaryAction:r("span",{style:{borderBottom:"1px solid rgb(8 141 245)",color:"rgb(8 141 245)",cursor:"pointer"},onClick:()=>C(e.urlTemp,"tset"),children:"Ver"}),children:[r(j,{children:r(D,{sx:{color:"#D72219"}})}),r(v,{primary:`${e.nombre}.pdf`,secondary:`${e.descripcion} - ${e.fecha?e.fecha:""}`})]}))}):r(d,{sx:{marginTop:"2em"},textAlign:"center",children:"No hay documentos firmados"})})})]})})})};export{_ as default};
