import{a2 as u,b0 as h,b1 as x,u as f,j as e,N as g,r as i,B as a,ah as F,o as n,M as b,p as m,ab as y,F as L,S as w,U as C,G as S}from"./index-e47c07e2.js";import{a as A}from"./abrirPDF-a6ef6d30.js";import{L as D,d as T}from"./PictureAsPdf-2d69fd1a.js";import{L as j}from"./ListItemIcon-49470498.js";import{L as v}from"./ListItemText-154abef8.js";const k=async s=>{const{data:o}=await u.post(`${h}/${x}/rest/firma/docsFirmados`,{idFirma:s});return o},E=()=>{const{authFirma:s,unAuthenticateSignature:o}=f();if(!s)return e(g,{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 k(r.idFirma);t.success?l(t.documentos):t.success||S.error(t.msg)}catch{}finally{d(!1)}})()},[]),e(a,{sx:{backgroundColor:"#F4F5FA",height:"100dvh"},children:e(F,{maxWidth:"xl",children:n(a,{children:[e(a,{width:"100%",display:"flex",justifyContent:"right",children:e(b,{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(y,{})]}),e(a,{width:"100%",sx:{marginTop:"1em"},children:p?e(D,{}):e(L,{children:c.length?e(w,{sx:{backgroundColor:"#FFF",padding:"0.5em",borderRadius:"2px",boxShadow:"rgba(149, 157, 165, 0.2) 0px 8px 24px"},children:c.map(r=>n(C,{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:()=>A(r.urlTemp,"tset"),children:"Ver"}),children:[e(j,{children:e(T,{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};
