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:
parent
566e1192cd
commit
948f3a7e04
7 changed files with 63 additions and 15 deletions
|
@ -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,
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue