@accounter/client
Version:
Accounter client application
1 lines • 1.6 kB
JavaScript
import{s as e}from"./dist-C51EwTaa.js";import{i as t,o as n}from"./utils-DdVdMk8X.js";import{Lo as r,li as i}from"./error-handling-Dpfd9svJ.js";import{ft as a}from"./select-CrsvQyhZ.js";import{t as o}from"./charges-table-CNFGsVad.js";import{t as s}from"./button-Dzp2INW0.js";import{Tt as c,cn as l,ct as u,ni as d,ri as f}from"./index-CL8-JoMZ.js";import{t as p}from"./use-url-query-BCNbSvLg.js";import{t as m}from"./page-layout-DoLDsSrs.js";var h=e(n(),1),g=t(),_=()=>{let{setFiltersContext:e}=(0,h.useContext)(l),[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)(c,{content:`Expand all accounts`,children:(0,g.jsx)(s,{variant:`outline`,size:`icon`,className:`size-7.5`,onClick:()=>n(e=>!e),children:t?(0,g.jsx)(f,{className:`size-5`}):(0,g.jsx)(d,{className:`size-5`})})}),(0,g.jsx)(u,{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};