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
+10 -7
View File
@@ -3,7 +3,7 @@
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
import { ExtendedLink } from "@/types/global";
import { LinkIncludingCollectionAndTags } from "@/types/global";
import {
faFolder,
faArrowUpRightFromSquare,
@@ -25,7 +25,7 @@ export default function ({
link,
count,
}: {
link: ExtendedLink;
link: LinkIncludingCollectionAndTags;
count: number;
}) {
const [expandDropdown, setExpandDropdown] = useState(false);
@@ -34,11 +34,14 @@ export default function ({
const { removeLink } = useLinkStore();
const url = new URL(link.url);
const formattedDate = new Date(link.createdAt).toLocaleString("en-US", {
year: "numeric",
month: "short",
day: "numeric",
});
const formattedDate = new Date(link.createdAt as string).toLocaleString(
"en-US",
{
year: "numeric",
month: "short",
day: "numeric",
}
);
const toggleEditModal = () => {
setEditModal(!editModal);