@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{t as r}from"./loader-circle-CfW9jOIr.js";import{t as i}from"./charges-table-ZLozA1tS.js";import{Qt as a,Sr as o,ct as s,xr as c}from"./common-D-vYt_Yl.js";import{r as l}from"./bank-deposits-e7ndUl2A.js";import{c as u}from"./separator-BvKylNhK.js";import{t as d}from"./button-DUNsVBiu.js";import{Qo as f,yi as p}from"./graphql-DC5GYCFE.js";import{t as m}from"./use-url-query-Bb8ddrDs.js";import{t as h}from"./page-layout-DfY10rJx.js";import{t as g}from"./charges-filters-jQtrB7Ny.js";var _=e(n(),1),v=t(),y=()=>{let{setFiltersContext:e}=(0,_.useContext)(u),[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}]=f({query:p,variables:{filters:w,page:b,limit:100}}),O=l(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)(s,{content:`Expand all accounts`,children:(0,v.jsx)(d,{variant:`outline`,size:`icon`,className:`size-7.5`,onClick:()=>n(e=>!e),children:t?(0,v.jsx)(o,{className:`size-5`}):(0,v.jsx)(c,{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)(r,{className:`h-10 w-10 animate-spin mr-2 self-center`}):(0,v.jsxs)(`div`,{className:`relative`,children:[(0,v.jsx)(a,{visible:D,overlayBlur:1}),(0,v.jsx)(i,{data:O??[],isAllOpened:t})]})})};export{y as MissingInfoCharges};