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

(limited to 'gui/src/components/post/RP.tsx')

diff --git a/gui/src/components/post/RP.tsx b/gui/src/components/post/RP.tsx
new file mode 100644
index 0000000..27fa02d
--- /dev/null
+++ b/gui/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),
+  };
+}
-- 
cgit v1.2.3

