diff --git a/src/components/nostr/RichText/Gallery.tsx b/src/components/nostr/RichText/Gallery.tsx
index 7a90734..659d470 100644
--- a/src/components/nostr/RichText/Gallery.tsx
+++ b/src/components/nostr/RichText/Gallery.tsx
@@ -8,7 +8,11 @@ import { MediaDialog } from "../MediaDialog";
import { MediaEmbed } from "../MediaEmbed";
import { useRichTextOptions } from "../RichText";
-function MediaPlaceholder({ type }: { type: "image" | "video" | "audio" }) {
+function MediaPlaceholder({
+ type,
+}: {
+ type: "image" | "video" | "audio" | "gallery";
+}) {
return [{type}];
}
@@ -62,32 +66,42 @@ export function Gallery({ node }: GalleryNodeProps) {
return null;
};
- // Only show dialog for audio files
+ // Separate media types for layout
+ const imageLinks = links.filter((url) => isImageURL(url));
+ const imageVideoLinks = links.filter(
+ (url) => isImageURL(url) || isVideoURL(url),
+ );
const audioLinks = links.filter((url) => isAudioURL(url));
- // Separate media types for layout
- const imageLinks = links.filter((url) => isImageURL(url) || isVideoURL(url));
- const audioOnlyLinks = links.filter((url) => isAudioURL(url));
+ // Check if images/videos/audio should be shown
+ const shouldShowImages = options.showMedia && options.showImages;
+ const shouldShowAudio = options.showMedia && options.showAudio;
+
+ // Show [gallery] placeholder when images are disabled and gallery contains images
+ const showGalleryPlaceholder = imageLinks.length > 0 && !shouldShowImages;
return (
<>
- {/* Grid layout for images/videos */}
- {imageLinks.length > 0 && (
+ {/* Show single [gallery] placeholder when images are disabled */}
+ {showGalleryPlaceholder &&