From 8751ba26ebf7b7761b9e237f2bf3453623dd1018 Mon Sep 17 00:00:00 2001
From: polwex <polwex@sortug.com>
Date: Mon, 6 Oct 2025 10:13:39 +0700
Subject: added frontend WS connection for demonstration purposes

---
 gui/src/components/post/Media.tsx | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 gui/src/components/post/Media.tsx

(limited to 'gui/src/components/post/Media.tsx')

diff --git a/gui/src/components/post/Media.tsx b/gui/src/components/post/Media.tsx
new file mode 100644
index 0000000..04ea156
--- /dev/null
+++ b/gui/src/components/post/Media.tsx
@@ -0,0 +1,35 @@
+import type { Media } from "@/types/trill";
+interface Props {
+  media: Media[];
+}
+function M({ media }: Props) {
+  return (
+    <div className="body-media">
+      {media.map((m, i) => {
+        return "video" in m.media ? (
+          <video key={JSON.stringify(m) + i} src={m.media.video} controls />
+        ) : "audio" in m.media ? (
+          <audio key={JSON.stringify(m) + i} src={m.media.audio} controls />
+        ) : "images" in m.media ? (
+          <Images key={JSON.stringify(m) + i} urls={m.media.images} />
+        ) : null;
+      })}
+    </div>
+  );
+}
+export default M;
+
+function Images({ urls }: { urls: string[] }) {
+  return (
+    <>
+      {urls.map((u, i) => (
+        <img
+          key={u + i}
+          className={`body-img body-img-1-of-${urls.length}`}
+          src={u}
+          alt=""
+        />
+      ))}
+    </>
+  );
+}
-- 
cgit v1.2.3

