@accounter/client
Version:
Accounter client application
1 lines • 1.83 kB
JavaScript
import{s as e}from"./dist-ypP48_Ax.js";import{i as t,o as n}from"./utils-CbS-oR5I.js";import{Zo as r,xi as i}from"./error-handling-Ba16dd60.js";import{dt as a}from"./select-CGZdhlc6.js";import{t as o}from"./charges-table-DIHM2-Yb.js";import{Qt as s,Sr as c,ct as l,xr as u}from"./common-1Fu9tchs.js";import{r as d}from"./bank-deposits-DcikSLWi.js";import{c as f}from"./separator-PpapAwKS.js";import{t as p}from"./button-DUNsVBiu.js";import{t as m}from"./use-url-query-BH1w9BvL.js";import{t as h}from"./page-layout-Bwes2wnp.js";import{t as g}from"./charges-filters-CnN9OZne.js";var _=e(n(),1),v=t(),y=()=>{let{setFiltersContext:e}=(0,_.useContext)(f),[t,n]=(0,_.useState)(!1),{get:y}=m(),[b,x]=(0,_.useState)(y(`page`)?Number(y(`page`)):0),S=y(`chargesFilters`),C=(0,_.useMemo)(()=>{if(S)try{return JSON.parse(decodeURIComponent(S))}catch{return}},[S]),[w,T]=(0,_.useState)(C),[{data:E,fetching:D}]=r({query:i,variables:{filters:w,page:b,limit:100}}),O=d(E?.chargesWithMissingRequiredInfo?.nodes),k=E?.chargesWithMissingRequiredInfo?.pageInfo.totalPages;return(0,_.useEffect)(()=>{e((0,v.jsxs)(`div`,{className:`flex flex-row gap-x-5`,children:[(0,v.jsx)(g,{filter:w,setFilter:T,activePage:b,setPage:x,totalPages:k,withDefaultDateRange:!1}),(0,v.jsx)(l,{content:`Expand all accounts`,children:(0,v.jsx)(p,{variant:`outline`,size:`icon`,className:`size-7.5`,onClick:()=>n(e=>!e),children:t?(0,v.jsx)(c,{className:`size-5`}):(0,v.jsx)(u,{className:`size-5`})})})]}))},[k,w,b,t,e,x,T,n]),(0,v.jsx)(h,{title:`Missing Info Charges`,description:`Review charges with missing required details`,children:D&&!E?(0,v.jsx)(a,{className:`h-10 w-10 animate-spin mr-2 self-center`}):(0,v.jsxs)(`div`,{className:`relative`,children:[(0,v.jsx)(s,{visible:D,overlayBlur:1}),(0,v.jsx)(o,{data:O??[],isAllOpened:t})]})})};export{y as MissingInfoCharges};