diff --git a/bskyembed/src/components/embed.tsx b/bskyembed/src/components/embed.tsx index d8801996..4457defc 100644 --- a/bskyembed/src/components/embed.tsx +++ b/bskyembed/src/components/embed.tsx @@ -19,9 +19,11 @@ import {Link} from './link' export function Embed({ content, labels, + hideRecord, }: { content: AppBskyFeedDefs.PostView['embed'] labels: AppBskyFeedDefs.PostView['labels'] + hideRecord?: boolean }) { const labelInfo = useMemo(() => labelsToInfo(labels), [labels]) @@ -40,6 +42,10 @@ export function Embed({ // Case 3: Record (quote or linked post) if (AppBskyEmbedRecord.isView(content)) { + if (hideRecord) { + return null + } + const record = content.record // Case 3.1: Post @@ -84,19 +90,14 @@ export function Embed({
{text &&{text}
} - {record.embeds - ?.filter(embed => { - if (AppBskyEmbedImages.isView(embed)) return true - if (AppBskyEmbedExternal.isView(embed)) return true - return false - }) - .map(embed => ( - - ))} + {record.embeds?.map(embed => ( + + ))} ) } @@ -164,13 +165,18 @@ export function Embed({ ) { return (