summaryrefslogtreecommitdiff
path: root/gui/src/components/feed/PostList.tsx
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-10-06 10:13:39 +0700
committerpolwex <polwex@sortug.com>2025-10-06 10:13:39 +0700
commit8751ba26ebf7b7761b9e237f2bf3453623dd1018 (patch)
treedc37f12b3fd9b1a1e7a1b54a51c80697f37a04e8 /gui/src/components/feed/PostList.tsx
parent6704650dcfccf609ccc203308df9004e0b511bb6 (diff)
added frontend WS connection for demonstration purposes
Diffstat (limited to 'gui/src/components/feed/PostList.tsx')
-rw-r--r--gui/src/components/feed/PostList.tsx33
1 files changed, 33 insertions, 0 deletions
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;