import{a as e}from"./chunk-BNv3lrIs.js";import{n as t,t as n}from"./jsx-runtime-pmtNMKr4.js";import{a as r,t as i}from"./logs-bGeMTgTc.js";import{t as a}from"./useMediaQuery-C_7KdS3g.js";import{t as o}from"./load-HIf6x4Qy.js";import{A as s}from"./index-CBXvBSuP.js";import{t as c}from"./withRouter-BfV3B9Vo.js";import{t as l}from"./DataTable-BuE1Zp8A.js";import{t as u}from"./useTheme-D5mB3Mad.js";var d=e(t(),1),f=n();function p(e){let{location:t,history:n}=e,[c,p]=(0,d.useState)(!0);(0,d.useEffect)(()=>{setTimeout(()=>{p(!1)},500)},[]);let[h,g]=(0,d.useState)([]),[_,v]=(0,d.useState)(10),[y,b]=(0,d.useState)(0),[x,S]=(0,d.useState)(1),[C,w]=(0,d.useState)(!1),[T,E]=(0,d.useState)(null),[D,O]=(0,d.useState)(null);return a(u().breakpoints.down(`sm`)),(0,d.useEffect)(()=>{(async()=>{try{S((await r()).data),g(m((await i(y+1,_)).data))}catch(e){console.error(e)}})()},[t,y,_]),(0,f.jsxs)(f.Fragment,{children:[c&&(0,f.jsx)(o,{}),(0,f.jsx)(`h1`,{children:`Logs del sistema`}),(0,f.jsx)(`div`,{className:`divTabla`,children:(0,f.jsx)(l,{title:`Listado de usuarios registrados`,datos:h,columnas:[{name:`ID`,selector:e=>e.id,omit:!0},{name:`USUARIO`,selector:e=>e.usuario,sortable:!0},{name:`EMAIL`,selector:e=>e.correo,sortable:!0},{name:`DISPOSITIVO`,selector:e=>e.dispositivo,sortable:!0},{name:`IP`,selector:e=>e.ip,sortable:!0},{name:`ACCIÓN REALIZADA`,selector:e=>e.mensaje,sortable:!0}],paginationServer:!0,paginationTotalRows:x,onChangePage:e=>{b(e)},onChangeRowsPerPage:e=>{v(e),b(0)}})}),(0,f.jsxs)(s,{show:C,onClose:()=>w(!1),maxWidth:`xl`,children:[(0,f.jsx)(s.Header,{closeButton:!0,onClose:()=>w(!1),children:D}),(0,f.jsx)(s.Body,{children:T})]})]})}function m(e){return e.map(e=>({id:e._id,folio:e.folio,usuario:e.usuario,correo:e.correo,dispositivo:e.dispositivo,ip:e.ip,descripcion:e.descripcion,mensaje:e.detalles.mensaje}))}var h=c(p);export{h as default};