(attachment: Attachment)
| 1 | import { Attachment, MotionMediaFamily, MotionMediaRole } from "@/types/proto/api/v1/attachment_service_pb"; |
| 2 | |
| 3 | export 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 | |
| 11 | export const getAttachmentThumbnailUrl = (attachment: Attachment) => { |
| 12 | return `${window.location.origin}/file/${attachment.name}/${attachment.filename}?thumbnail=true`; |
no outgoing calls
no test coverage detected