1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

added lab sorting

This commit is contained in:
Fedor Katurov 2022-03-23 17:54:51 +07:00
parent 566e1192cd
commit 948f3a7e04
7 changed files with 63 additions and 15 deletions

View file

@ -1,9 +1,25 @@
import { useState } from 'react';
import { useGetLabNodes } from '~/hooks/lab/useGetLabNodes';
import { useGetLabStats } from '~/hooks/lab/useGetLabStats';
import { LabNodesSort } from '~/types/lab';
export const useLab = () => {
const { nodes, isLoading, loadMore, hasMore } = useGetLabNodes();
const [sort, setSort] = useState<LabNodesSort>(LabNodesSort.New);
const { nodes, isLoading, loadMore, hasMore } = useGetLabNodes(sort);
const { tags, heroes, updates, isLoading: isLoadingStats } = useGetLabStats();
return { isLoading, nodes, hasMore, loadMore, tags, heroes, isLoadingStats, updates };
return {
isLoading,
nodes,
hasMore,
loadMore,
tags,
heroes,
isLoadingStats,
updates,
sort,
setSort,
};
};