summaryrefslogtreecommitdiff
path: root/front/src/components/post/RP.tsx
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-09-17 15:56:00 +0700
committerpolwex <polwex@sortug.com>2025-09-17 15:56:00 +0700
commitf0df4c7297a05bd592d8717b8997284c80fd0500 (patch)
tree2d38e079e971a2e98e78a0f7a3104f2bd3c5daeb /front/src/components/post/RP.tsx
parent387af8fc1603805b02ce03f8adba4fa73a954f7c (diff)
argh
Diffstat (limited to 'front/src/components/post/RP.tsx')
-rw-r--r--front/src/components/post/RP.tsx47
1 files changed, 47 insertions, 0 deletions
diff --git a/front/src/components/post/RP.tsx b/front/src/components/post/RP.tsx
new file mode 100644
index 0000000..27fa02d
--- /dev/null
+++ b/front/src/components/post/RP.tsx
@@ -0,0 +1,47 @@
+import Post from "./Post";
+import type { Ship } from "@/types/urbit";
+import type { Poast, FullNode, ID } from "@/types/trill";
+import PostData from "./Loader";
+export default function (props: {
+ host: string;
+ id: string;
+ rter: Ship;
+ rtat: number;
+ rtid: ID;
+ refetch?: Function;
+}) {
+ return PostData(props)(RP);
+}
+
+function RP({
+ data,
+ refetch,
+ rter,
+ rtat,
+ rtid,
+}: {
+ data: FullNode;
+ refetch: Function;
+ rter: Ship;
+ rtat: number;
+ rtid: ID;
+}) {
+ return (
+ <Post
+ poast={toFlat(data)}
+ rter={rter}
+ rtat={rtat}
+ rtid={rtid}
+ refetch={refetch}
+ />
+ );
+}
+
+export function toFlat(n: FullNode): Poast {
+ return {
+ ...n,
+ children: !n.children
+ ? []
+ : Object.keys(n.children).map((c) => n.children[c].id),
+ };
+}