@accounter/client
Version:
Accounter client application
1 lines • 1.63 kB
JavaScript
import{s as e}from"./dist-BmACi7k_.js";import{i as t,o as n}from"./utils-BxkqV8PM.js";import{Go as r,_i as i}from"./error-handling-DOF-ysm7.js";import{ut as a}from"./select-BZkoGTFP.js";import{t as o}from"./charges-table-CNj76ME_.js";import{W as s,br as c,st as l,xr as u}from"./common-_Cbgbzg_.js";import{c as d}from"./separator-DX7kO-_W.js";import{t as f}from"./button-BZ6z_NAl.js";import{t as p}from"./use-url-query-DXFemxIX.js";import{t as m}from"./page-layout-kYT4HQy5.js";var h=e(n(),1),g=t(),_=()=>{let{setFiltersContext:e}=(0,h.useContext)(d),[t,n]=(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}]=r({query:i,variables:{page:b,limit:100}});function T(){v([])}return(0,h.useEffect)(()=>{e((0,g.jsxs)(`div`,{className:`flex flex-row gap-x-5`,children:[(0,g.jsx)(l,{content:`Expand all accounts`,children:(0,g.jsx)(f,{variant:`outline`,size:`icon`,className:`size-7.5`,onClick:()=>n(e=>!e),children:t?(0,g.jsx)(u,{className:`size-5`}):(0,g.jsx)(c,{className:`size-5`})})}),(0,g.jsx)(s,{selected:_,resetMerge:T})]}))},[C,w,b,t,e,x,n,_]),(0,g.jsx)(m,{title:`Missing Info Charges`,description:`Review charges with missing required details`,children:!C?.chargesWithMissingRequiredInfo.nodes||w?(0,g.jsx)(a,{className:`h-10 w-10 animate-spin mr-2 self-center`}):(0,g.jsx)(o,{toggleMergeCharge:S,mergeSelectedCharges:new Set(_.map(e=>e.id)),data:C?.chargesWithMissingRequiredInfo?.nodes,isAllOpened:t})})};export{_ as MissingInfoCharges};