summaryrefslogtreecommitdiff
path: root/gui/src/components/post/Quote.tsx
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-10-06 10:13:39 +0700
committerpolwex <polwex@sortug.com>2025-10-06 10:13:39 +0700
commit8751ba26ebf7b7761b9e237f2bf3453623dd1018 (patch)
treedc37f12b3fd9b1a1e7a1b54a51c80697f37a04e8 /gui/src/components/post/Quote.tsx
parent6704650dcfccf609ccc203308df9004e0b511bb6 (diff)
added frontend WS connection for demonstration purposes
Diffstat (limited to 'gui/src/components/post/Quote.tsx')
-rw-r--r--gui/src/components/post/Quote.tsx64
1 files changed, 64 insertions, 0 deletions
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;