improved typesafety

This commit is contained in:
Daniel
2023-05-27 19:59:39 +03:30
parent a0a7ccc952
commit 36778810c5
11 changed files with 87 additions and 89 deletions
+4 -3
View File
@@ -7,7 +7,7 @@ import React, { useState } from "react";
import CollectionSelection from "@/components/InputSelect/CollectionSelection";
import TagSelection from "@/components/InputSelect/TagSelection";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { ExtendedLink } from "@/types/global";
import { LinkIncludingCollectionAndTags } from "@/types/global";
import { faPenToSquare } from "@fortawesome/free-regular-svg-icons";
import useLinkStore from "@/store/links";
import { faTrashCan } from "@fortawesome/free-solid-svg-icons";
@@ -15,11 +15,12 @@ import RequiredBadge from "../RequiredBadge";
type Props = {
toggleLinkModal: Function;
link: ExtendedLink;
link: LinkIncludingCollectionAndTags;
};
export default function EditLink({ toggleLinkModal, link }: Props) {
const [currentLink, setCurrentLink] = useState<ExtendedLink>(link);
const [currentLink, setCurrentLink] =
useState<LinkIncludingCollectionAndTags>(link);
const { updateLink, removeLink } = useLinkStore();