diff --git a/client/src/components/Modals/QuoteEmbed.tsx b/client/src/components/Modals/QuoteEmbed.tsx
index f0eac77..327718d 100644
--- a/client/src/components/Modals/QuoteEmbed.tsx
+++ b/client/src/components/Modals/QuoteEmbed.tsx
@@ -2,6 +2,7 @@ import { parseContent } from '../../utils/content';
import { Event } from 'nostr-tools';
import { getMetadata, uniqBy } from '../../utils/utils';
import ContentPreview from './TextModal';
+import { renderMedia } from '../../utils/FileUpload';
const colorCombos = [
'from-red-400 to-yellow-500',
@@ -81,14 +82,7 @@ const QuoteEmbed = ({ event, metadata }: { event: Event, metadata: Event | null}
diff --git a/client/src/components/PostCard/PostCard.tsx b/client/src/components/PostCard/PostCard.tsx
index 5a52024..a6f88ae 100644
--- a/client/src/components/PostCard/PostCard.tsx
+++ b/client/src/components/PostCard/PostCard.tsx
@@ -5,6 +5,7 @@ import { Event } from 'nostr-tools';
import { nip19 } from 'nostr-tools';
import { getMetadata } from '../../utils/utils';
import ContentPreview from'../Modals/TextModal';
+import { renderMedia } from '../../utils/FileUpload';
const colorCombos = [
'from-red-400 to-yellow-500',
@@ -92,14 +93,7 @@ const PostCard = ({ key, event, metadata, replyCount }: { key: string, event: Ev
- {file !== "" && (
-
-
-
- )}
+ {renderMedia(file)}
diff --git a/client/src/components/Thread/OPCard.tsx b/client/src/components/Thread/OPCard.tsx
index 247d33b..f60989c 100644
--- a/client/src/components/Thread/OPCard.tsx
+++ b/client/src/components/Thread/OPCard.tsx
@@ -4,6 +4,7 @@ import { parseContent } from '../../utils/content';
import { Event } from 'nostr-tools';
import { getMetadata } from '../../utils/utils';
import ContentPreview from '../Modals/TextModal';
+import { renderMedia } from '../../utils/FileUpload';
const colorCombos = [
'from-red-400 to-yellow-500',
@@ -89,37 +90,11 @@ const OPCard = ({ event, metadata, replyCount }: { event: Event, metadata: Event
- {file !== "" && (
-
-
-
- )}
+ {renderMedia(file)}
>
);
};
-interface LinkPreview {
- url: string;
- title: string;
- siteName?: string;
- description?: string;
- mediaType: string;
- contentType?: string;
- images: string[];
- videos: {
- url?: string;
- secureUrl?: string;
- type?: string;
- width?: string;
- height?: string;
- [key: string]: any;
- }[];
- [key: string]: any;
-}
-
export default OPCard;
\ No newline at end of file
diff --git a/client/src/components/Thread/ReplyCard.tsx b/client/src/components/Thread/ReplyCard.tsx
index 818f01d..20bbb93 100644
--- a/client/src/components/Thread/ReplyCard.tsx
+++ b/client/src/components/Thread/ReplyCard.tsx
@@ -5,7 +5,7 @@ import { Event } from 'nostr-tools';
import { nip19 } from 'nostr-tools';
import { getMetadata, uniqBy } from '../../utils/utils';
import ContentPreview from '../Modals/TextModal';
-import { useEffect, useState } from 'react';
+import { renderMedia } from '../../utils/FileUpload';
const colorCombos = [
'from-red-400 to-yellow-500',
@@ -108,14 +108,7 @@ const ReplyCard = ({ event, metadata, replyCount, repliedTo }: { event: Event, m