import{r as e}from"./chunk-QTnfLwEv.js";import{n as t,t as n}from"./jsx-runtime-BWRPWl8p.js";import{t as r}from"./dayjs.min-aszMaMjE.js";import{C as i,Lr as a,S as o,W as s,b as c}from"./index-DccLTdzK.js";import{t as l}from"./PageHeader-DNnlanBD.js";import{t as u}from"./DataTable-KLBE0uXO.js";import{t as d}from"./useTheme-ClV7RdEj.js";import{t as f}from"./useMediaQuery-Diq4jKog.js";import{r as p}from"./preciosOrden-TGSOGiwM.js";var m=e(t(),1);i();var h=e(r(),1),g=e(o(),1),_=n(),v=e=>{let{location:t,history:n}=e;h.default.locale(`es`),h.default.extend(g.default);let[r,i]=(0,m.useState)(!0);(0,m.useEffect)(()=>{setTimeout(()=>{i(!1)},500)},[]);let[o,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 f(d().breakpoints.down(`sm`)),(0,_.jsxs)(`div`,{style:{marginTop:`1%`},children:[r&&(0,_.jsx)(s,{}),(0,_.jsx)(l,{title:`Cargos y descuentos registrados`,icon:a}),(0,_.jsx)(`div`,{className:`divTabla`,style:{textTransform:`capitalize`},children:(0,_.jsx)(u,{title:`Lista de cargos y descuentos registrados`,datos:o,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};