diff options
author | polwex <polwex@sortug.com> | 2025-09-11 01:48:14 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-09-11 01:48:14 +0700 |
commit | b1d68ac307ed87d63e83820cbdf843fff0fd9f7f (patch) | |
tree | d6a684a70a80509e68ff667b842aa4e4c091906f /front/src/components/feed/PostList.tsx |
init
Diffstat (limited to 'front/src/components/feed/PostList.tsx')
-rw-r--r-- | front/src/components/feed/PostList.tsx | 32 |
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; |