import{$ as u,u as h,j as e,N as f,r as i,B as a,a9 as x,o as n,K as g,p as m,a6 as F,F as y,P as b,Q as L,z as w}from"./index-7722cded.js";import{a as C}from"./abrirPDF-a6ef6d30.js";import{L as A,d as D}from"./PictureAsPdf-a0aef435.js";import{b as S,p as T}from"./env-198ff0f3.js";import{L as j}from"./ListItemIcon-2e1ef9a9.js";import{L as v}from"./ListItemText-3ed23339.js";const $=async s=>{const{data:o}=await u.post(`${S}/${T}/rest/firma/docsFirmados`,{idFirma:s});return o},E=()=>{const{authFirma:s,unAuthenticateSignature:o}=h();if(!s)return e(f,{to:"/firma-verificar"});const[c,l]=i.useState([]),[p,d]=i.useState(!0);return i.useEffect(()=>{const r=JSON.parse(localStorage.getItem("authFirma"));(async()=>{d(!0);try{const t=await $(r.idFirma);t.success?l(t.documentos):t.success||w.error(t.msg)}catch{}finally{d(!1)}})()},[]),e(a,{sx:{backgroundColor:"#F4F5FA",height:"100dvh"},children:e(x,{maxWidth:"xl",children:n(a,{children:[e(a,{width:"100%",display:"flex",justifyContent:"right",children:e(g,{sx:{marginTop:"1em"},variant:"contained",size:"small",onClick:o,children:"Salir"})}),n(a,{width:"100%",sx:{paddingTop:"2em",display:"flex"},children:[e(a,{display:"flex",justifyContent:"space-between",flexDirection:"row",children:e(m,{level:"h1",gutterBottom:!0,component:"h1",children:"Documentos firmados"})}),e(F,{})]}),e(a,{width:"100%",sx:{marginTop:"1em"},children:p?e(A,{}):e(y,{children:c.length?e(b,{sx:{backgroundColor:"#FFF",padding:"0.5em",borderRadius:"2px",boxShadow:"rgba(149, 157, 165, 0.2) 0px 8px 24px"},children:c.map(r=>n(L,{sx:{borderRadius:"2px",backgroundColor:"#FAFAF9",marginY:"0.5em"},secondaryAction:e("span",{style:{borderBottom:"1px solid rgb(8 141 245)",color:"rgb(8 141 245)",cursor:"pointer"},onClick:()=>C(r.urlTemp,"tset"),children:"Ver"}),children:[e(j,{children:e(D,{sx:{color:"#D72219"}})}),e(v,{primary:`${r.nombre}.pdf`,secondary:`${r.descripcion} - ${r.fecha?r.fecha:""}`})]}))}):e(m,{sx:{marginTop:"2em"},textAlign:"center",children:"No hay documentos firmados"})})})]})})})};export{E as default};
