diff --git a/tldraw/apps/tldraw-logseq/src/components/BlockLink/BlockLink.tsx b/tldraw/apps/tldraw-logseq/src/components/BlockLink/BlockLink.tsx index a7b1607162..1e5701a867 100644 --- a/tldraw/apps/tldraw-logseq/src/components/BlockLink/BlockLink.tsx +++ b/tldraw/apps/tldraw-logseq/src/components/BlockLink/BlockLink.tsx @@ -3,7 +3,13 @@ import React from 'react' import { LogseqContext } from '../../lib/logseq-context' import { TablerIcon } from '../icons' -export const BlockLink = ({ id }: { id: string }) => { +export const BlockLink = ({ + id, + showReferenceContent = false, +}: { + id: string + showReferenceContent?: boolean +}) => { const { handlers: { isWhiteboardPage, redirectToPage, sidebarAddBlock, queryBlockByUUID }, renderers: { Breadcrumb, PageName, BlockReference }, @@ -11,13 +17,16 @@ export const BlockLink = ({ id }: { id: string }) => { let iconName = '' let linkType = validUUID(id) ? 'B' : 'P' + let blockContent = '' if (validUUID(id)) { const block = queryBlockByUUID(id) if (!block) { - return Invalid reference. Did you remove it? + return Invalid reference. Did you remove it? } + blockContent = block.content + if (block.properties?.['ls-type'] === 'whiteboard-shape') { iconName = 'link-to-whiteboard' } else { @@ -31,6 +40,9 @@ export const BlockLink = ({ id }: { id: string }) => { } } + const slicedContent = + blockContent && blockContent.length > 23 ? blockContent.slice(0, 20) + '...' : blockContent + return (