@accounter/client
Version:
Accounter client application
1 lines • 1.43 kB
JavaScript
import{t as e}from"./charges-table-DUk3RSMw.js";import{$s as t,Al as n,Cu as r,Id as i,It as a,Ju as o,Wl as s,Zu as c,en as l,er as u,jd as d,qu as f}from"./index-DUZECcXr.js";import{t as p}from"./use-url-query-Ds69k5Os.js";import{t as m}from"./page-layout-BfWJC_SV.js";var h=i(d(),1),g=r(),_=()=>{let{setFiltersContext:r}=(0,h.useContext)(u),[i,d]=(0,h.useState)(!1),[_,v]=(0,h.useState)([]),{get:y}=p(),[b,x]=(0,h.useState)(y(`page`)?Number(y(`page`)):1),S=(0,h.useCallback)((e,t)=>{_.map(e=>e.id).includes(e)?v(_.filter(t=>t.id!==e)):v([..._,{id:e,onChange:t}])},[_]),[{data:C,fetching:w}]=n({query:t,variables:{page:b,limit:100}});function T(){v([])}return(0,h.useEffect)(()=>{r((0,g.jsxs)(`div`,{className:`flex flex-row gap-x-5`,children:[(0,g.jsx)(l,{content:`Expand all accounts`,children:(0,g.jsx)(s,{variant:`outline`,size:`icon`,className:`size-7.5`,onClick:()=>d(e=>!e),children:i?(0,g.jsx)(o,{className:`size-5`}):(0,g.jsx)(f,{className:`size-5`})})}),(0,g.jsx)(a,{selected:_,resetMerge:T})]}))},[C,w,b,i,r,x,d,_]),(0,g.jsx)(m,{title:`Missing Info Charges`,description:`Review charges with missing required details`,children:!C?.chargesWithMissingRequiredInfo.nodes||w?(0,g.jsx)(c,{className:`h-10 w-10 animate-spin mr-2 self-center`}):(0,g.jsx)(e,{toggleMergeCharge:S,mergeSelectedCharges:new Set(_.map(e=>e.id)),data:C?.chargesWithMissingRequiredInfo?.nodes,isAllOpened:i})})};export{_ as MissingInfoCharges};