summaryrefslogtreecommitdiff
path: root/front/src/components/feed/PostList.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'front/src/components/feed/PostList.tsx')
-rw-r--r--front/src/components/feed/PostList.tsx32
1 files changed, 32 insertions, 0 deletions
diff --git a/front/src/components/feed/PostList.tsx b/front/src/components/feed/PostList.tsx
new file mode 100644
index 0000000..3d41ff8
--- /dev/null
+++ b/front/src/components/feed/PostList.tsx
@@ -0,0 +1,32 @@
+import TrillPost from "./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()
+ .map((i) => (
+ <TrillPost key={i} poast={data.feed[i]} refetch={refetch} />
+ ))}
+ </>
+ );
+}
+
+export default TrillFeed;