- {content.images.map((image, i) => (
+ {images.map((image, i) => (
- {content.images.slice(1).map((image, i) => (
+ {images.slice(1).map((image, i) => (
)
- case 4:
+ default: {
+ const remaining = images.length - 4
return (
- {content.images.map((image, i) => (
-

- ))}
+ {images.slice(0, 4).map((image, i) => {
+ const isOverflowCell = i === 3 && remaining > 0
+ return (
+
+

+ {isOverflowCell && (
+
+
+ +{remaining}
+
+
+ )}
+
+ )
+ })}
)
- default:
- return null
+ }
}
}
diff --git a/bskyembed/src/components/post.tsx b/bskyembed/src/components/post.tsx
index 4167dc0869..46faebc4a7 100644
--- a/bskyembed/src/components/post.tsx
+++ b/bskyembed/src/components/post.tsx
@@ -154,7 +154,9 @@ export function Post({thread}: Props) {
}
function PostContent({record}: {record: AppBskyFeedPost.Record | null}) {
- if (!record) return null
+ // text-only check - posts with no text (e.g. gallery posts) would otherwise
+ // render an empty
that adds an extra flex gap above the embed
+ if (!record?.text) return null
const rt = new RichText({
text: record.text,