import{a as e}from"./chunk-BNv3lrIs.js";import{n as t,t as n}from"./jsx-runtime-pmtNMKr4.js";import{t as r}from"./useMediaQuery-C_7KdS3g.js";import{t as i}from"./load-HIf6x4Qy.js";import{t as a}from"./dayjs.min-CvL7oEs_.js";import{t as o}from"./es-B8cbrmO0.js";import{t as s}from"./localizedFormat-CVLUt9Cf.js";import{b as c,br as l}from"./index-CBXvBSuP.js";import{t as u}from"./PageHeader-C3X_ZaAc.js";import{t as d}from"./DataTable-BuE1Zp8A.js";import{t as f}from"./useTheme-D5mB3Mad.js";import{r as p}from"./preciosOrden-i_xV0IuB.js";var m=e(t(),1);o();var h=e(a(),1),g=e(s(),1),_=n(),v=e=>{let{location:t,history:n}=e;h.default.locale(`es`),h.default.extend(g.default);let[a,o]=(0,m.useState)(!0);(0,m.useEffect)(()=>{setTimeout(()=>{o(!1)},500)},[]);let[s,v]=(0,m.useState)([]),b=()=>{try{p().then(e=>{let{data:t}=e;console.log(t),v(y(t))}).catch(e=>{})}catch{}};(0,m.useEffect)(()=>{b()},[t]);let x=[{name:`ID TRANSACCIÓN`,selector:e=>e.id,omit:!0},{name:`ORDEN DE CLIENTE`,selector:e=>e.ordenServicio,sortable:!0},{name:`TIPO DE OPERACIÓN`,selector:e=>e.tipoOperacion,sortable:!0},{name:`CONCEPTO`,selector:e=>e.concepto,sortable:!0},{name:`CANTIDAD`,selector:e=>e.cantidad,sortable:!0,cell:e=>(0,_.jsx)(`span`,{children:S(e.cantidad)})},{name:`REGISTRÓ`,selector:e=>e.correoRegistro,sortable:!0},{name:`FECHA`,selector:e=>e.fecha,sortable:!0,cell:e=>c(e.fecha)}],S=e=>new Intl.NumberFormat(`es-MX`,{style:`currency`,currency:`MXN`,minimumFractionDigits:2}).format(e);return r(f().breakpoints.down(`sm`)),(0,_.jsxs)(`div`,{style:{marginTop:`1%`},children:[a&&(0,_.jsx)(i,{}),(0,_.jsx)(u,{title:`Cargos y descuentos registrados`,icon:l}),(0,_.jsx)(`div`,{className:`divTabla`,style:{textTransform:`capitalize`},children:(0,_.jsx)(d,{title:`Lista de cargos y descuentos registrados`,datos:s,columnas:x})})]})};function y(e){let t=[];return e.forEach(e=>{t.push({id:e._id,ordenServicio:e.ordenServicio,tipoOperacion:e.tipo,concepto:e.concepto,cantidad:e.cantidad,correoRegistro:e.correoRegistro,fecha:e.fecha,estado:e.estado})}),t}export{v as default};