diff --git a/frontend/web/src/components/CollectionView.tsx b/frontend/web/src/components/CollectionView.tsx index 20e6f20..fffecc6 100644 --- a/frontend/web/src/components/CollectionView.tsx +++ b/frontend/web/src/components/CollectionView.tsx @@ -1,7 +1,10 @@ import classNames from "classnames"; +import copy from "copy-to-clipboard"; import { useState } from "react"; +import toast from "react-hot-toast"; import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; +import { absolutifyLink } from "@/helpers/utils"; import useNavigateTo from "@/hooks/useNavigateTo"; import useResponsiveWidth from "@/hooks/useResponsiveWidth"; import { useAppSelector } from "@/stores"; @@ -30,6 +33,11 @@ const CollectionView = (props: Props) => { .map((shortcutId) => shortcutList.find((shortcut) => shortcut?.id === shortcutId)) .filter(Boolean) as any as Shortcut[]; + const handleCopyCollectionLink = () => { + copy(absolutifyLink(`/c/${collection.name}`)); + toast.success("Collection link copied to clipboard."); + }; + const handleDeleteCollectionButtonClick = () => { showCommonDialog({ title: "Delete Collection", @@ -49,10 +57,12 @@ const CollectionView = (props: Props) => { <>
{collection.description}
No shortcuts found.
+