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/feed/PostList.tsx | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 gui/src/components/feed/PostList.tsx

(limited to 'gui/src/components/feed/PostList.tsx')

diff --git a/gui/src/components/feed/PostList.tsx b/gui/src/components/feed/PostList.tsx
new file mode 100644
index 0000000..b09a0e9
--- /dev/null
+++ b/gui/src/components/feed/PostList.tsx
@@ -0,0 +1,33 @@
+import TrillPost from "@/components/post/Post";
+import type { FC } from "@/types/trill";
+// import { useEffect } from "react";
+// import { useQueryClient } from "@tanstack/react-query";
+// import { toFull } from "../thread/helpers";
+
+function TrillFeed({ data, refetch }: { data: FC; refetch: Function }) {
+  // const qc = useQueryClient();
+  // useEffect(() => {
+  //   Object.values(data.feed).forEach((poast) => {
+  //     const queryKey = ["trill-thread", poast.host, poast.id];
+  //     const existing = qc.getQueryData(queryKey);
+  //     if (!existing || !("fpost" in (existing as any))) {
+  //       qc.setQueryData(queryKey, {
+  //         fpost: toFull(poast),
+  //       });
+  //     }
+  //   });
+  // }, [data]);
+  return (
+    <>
+      {Object.keys(data.feed)
+        .sort()
+        .reverse()
+        .slice(0, 50)
+        .map((i) => (
+          <TrillPost key={i} poast={data.feed[i]} refetch={refetch} />
+        ))}
+    </>
+  );
+}
+
+export default TrillFeed;
-- 
cgit v1.2.3

