renamed a type + small improvements

This commit is contained in:
Daniel
2023-06-16 16:25:21 +03:30
parent 93558bb791
commit c1831b650d
18 changed files with 70 additions and 70 deletions
+7 -3
View File
@@ -1,12 +1,14 @@
import {
CollectionIncludingMembers,
CollectionIncludingMembersAndLinkCount,
LinkIncludingShortenedCollectionAndTags,
Sort,
} from "@/types/global";
import { SetStateAction, useEffect } from "react";
type Props<
T extends CollectionIncludingMembers | LinkIncludingShortenedCollectionAndTags
T extends
| CollectionIncludingMembersAndLinkCount
| LinkIncludingShortenedCollectionAndTags
> = {
sortBy: Sort;
@@ -15,7 +17,9 @@ type Props<
};
export default function useSort<
T extends CollectionIncludingMembers | LinkIncludingShortenedCollectionAndTags
T extends
| CollectionIncludingMembersAndLinkCount
| LinkIncludingShortenedCollectionAndTags
>({ sortBy, data, setData }: Props<T>) {
useEffect(() => {
const dataArray = [...data];