MCPcopy Create free account
hub / github.com/alanagoyal/docbase / handleCopyLink

Function handleCopyLink

components/documents.tsx:57–71  ·  view source on GitHub ↗
(documentId: string)

Source from the content-addressed store, hash-verified

55 }
56
57 const handleCopyLink = (documentId: string) => {
58 const link = `${process.env.NEXT_PUBLIC_SITE_URL}/links/view/${documentId}`
59 navigator.clipboard
60 .writeText(link)
61 .then(() => {
62 toast({
63 description: "Your link has been copied",
64 })
65 })
66 .catch((error) => {
67 toast({
68 description: "There was an error copying your link",
69 })
70 })
71 }
72
73 const linkUrl = (document: Document) => {
74 return `${process.env.NEXT_PUBLIC_SITE_URL}/links/view/${document.id}`

Callers 1

DocumentsFunction · 0.70

Calls 1

toastFunction · 0.90

Tested by

no test coverage detected