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

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

diff --git a/gui/src/components/post/Quote.tsx b/gui/src/components/post/Quote.tsx
new file mode 100644
index 0000000..28149f0
--- /dev/null
+++ b/gui/src/components/post/Quote.tsx
@@ -0,0 +1,64 @@
+import type { FullNode, Poast } from "@/types/trill";
+import { date_diff } from "@/logic/utils";
+import { useLocation } from "wouter";
+import Body from "./Body";
+import Sigil from "../Sigil";
+
+// function Quote({
+//   data,
+//   refetch,
+//   nest,
+// }: {
+//   data: FullNode;
+//   refetch?: Function;
+//   nest: number;
+// }) {
+//   const [_, navigate] = useLocation();
+//   function gotoQuote(e: React.MouseEvent) {
+//     e.stopPropagation();
+//     navigate(`/feed/${data.host}/${data.id}`);
+//   }
+//   return (
+//     <div onMouseUp={gotoQuote} className="quote-in-post">
+//       <header className="btw">
+//         (
+//         <div className="quote-author flex">
+//           <Sigil patp={data.author} size={20} />
+//           {data.author}
+//         </div>
+//         )<span>{date_diff(data.time, "short")}</span>
+//       </header>
+//       <Body poast={toFlat(data)} nest={nest} refetch={refetch!} />
+//     </div>
+//   );
+// }
+function Quote({
+  data,
+  refetch,
+  nest,
+}: {
+  data: Poast;
+  refetch?: Function;
+  nest: number;
+}) {
+  const [_, navigate] = useLocation();
+  function gotoQuote(e: React.MouseEvent) {
+    e.stopPropagation();
+    navigate(`/feed/${data.host}/${data.id}`);
+  }
+  return (
+    <div onMouseUp={gotoQuote} className="quote-in-post">
+      <header className="btw">
+        (
+        <div className="quote-author flex">
+          <Sigil patp={data.author} size={20} />
+          {data.author}
+        </div>
+        )<span>{date_diff(data.time, "short")}</span>
+      </header>
+      <Body poast={data} nest={nest} refetch={refetch!} />
+    </div>
+  );
+}
+
+export default Quote;
-- 
cgit v1.2.3

