import{useState as M}from"react";import{useActions as V}from"../../Sidebar/useActions";import{useCatalogFilter as k}from"./useCatalogFilter";import{useCatalogSort as Q}from"./useCatalogSort";import{useCatalogSearch as b}from"./useCatalogSearch";import{useCatalogViewMode as v}from"./useCatalogViewMode";function j(e){const{config:t,serverFilters:o,entitiesCounterInitial:i,initialViewMode:r}=e??{},{filters:s,filterQuery:n}=k(t,o),{sortOption:a,setSortOption:l,handleSortClick:c,isColumnSorted:u}=Q(),{searchQuery:C,setSearchQuery:m}=b(),{viewMode:p,setViewMode:f}=v(r),{onChangeViewClick:d,onChangeCollapseSidebarClick:S,layout:g,collapsedSidebar:h}=V(),[w,y]=M(i||0);return{filters:s,filterQuery:n,searchQuery:C,setSearchQuery:m,sortOption:a,setSortOption:l,handleSortClick:c,isColumnSorted:u,viewMode:p,setViewMode:f,entitiesCounter:w,setEntitiesCounter:y,onChangeViewClick:d,onChangeCollapseSidebarClick:S,layout:g,collapsedSidebar:h}}export{j as useCatalog};
