|
@@ -66,8 +66,6 @@ const Collections = () => {
|
|
|
const { handleAction } = useLoadAndReleaseDialogHook({ type: 'collection' });
|
|
|
const { handleInsertDialog } = useInsertDialogHook();
|
|
|
const [collections, setCollections] = useState<CollectionView[]>([]);
|
|
|
- const [orderBy, setOrderBy] = useState('');
|
|
|
- const [order, setOrder] = useState<'asc' | 'desc'>('asc');
|
|
|
|
|
|
const [searchedCollections, setSearchedCollections] = useState<
|
|
|
CollectionView[]
|
|
@@ -79,7 +77,10 @@ const Collections = () => {
|
|
|
handleCurrentPage,
|
|
|
total,
|
|
|
data: collectionList,
|
|
|
- } = usePaginationHook(searchedCollections, orderBy, order);
|
|
|
+ handleGridSort,
|
|
|
+ order,
|
|
|
+ orderBy,
|
|
|
+ } = usePaginationHook(searchedCollections);
|
|
|
const [loading, setLoading] = useState<boolean>(true);
|
|
|
const [selectedCollections, setSelectedCollections] = useState<
|
|
|
CollectionView[]
|
|
@@ -418,12 +419,6 @@ const Collections = () => {
|
|
|
setSelectedCollections([]);
|
|
|
};
|
|
|
|
|
|
- const handleGridSort = (e: any, property: string) => {
|
|
|
- const isAsc = orderBy === property && order === 'asc';
|
|
|
- setOrder(isAsc ? 'desc' : 'asc');
|
|
|
- setOrderBy(property);
|
|
|
- };
|
|
|
-
|
|
|
const CollectionIcon = icons.navCollection;
|
|
|
|
|
|
return (
|