MCPcopy
hub / github.com/usememos/memos / getAttachmentUrl

Function getAttachmentUrl

web/src/utils/attachment.ts:3–9  ·  view source on GitHub ↗
(attachment: Attachment)

Source from the content-addressed store, hash-verified

1import { Attachment, MotionMediaFamily, MotionMediaRole } from "@/types/proto/api/v1/attachment_service_pb";
2
3export const getAttachmentUrl = (attachment: Attachment) => {
4 if (attachment.externalLink) {
5 return attachment.externalLink;
6 }
7
8 return `${window.location.origin}/file/${attachment.name}/${attachment.filename}`;
9};
10
11export const getAttachmentThumbnailUrl = (attachment: Attachment) => {
12 return `${window.location.origin}/file/${attachment.name}/${attachment.filename}?thumbnail=true`;

Callers 7

AttachmentIconFunction · 0.90
AudioListFunction · 0.90
DocsListFunction · 0.90
AttachmentCardFunction · 0.90
attachmentGroupToItemFunction · 0.90
buildAppleMotionItemFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected