From f0df4c7297a05bd592d8717b8997284c80fd0500 Mon Sep 17 00:00:00 2001
From: polwex <polwex@sortug.com>
Date: Wed, 17 Sep 2025 15:56:00 +0700
Subject: argh

---
 front/src/components/composer/Snippets.tsx | 62 ++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 front/src/components/composer/Snippets.tsx

(limited to 'front/src/components/composer/Snippets.tsx')

diff --git a/front/src/components/composer/Snippets.tsx b/front/src/components/composer/Snippets.tsx
new file mode 100644
index 0000000..30498d0
--- /dev/null
+++ b/front/src/components/composer/Snippets.tsx
@@ -0,0 +1,62 @@
+import Quote from "@/components/post/Quote";
+import type { ComposerData, SPID } from "@/types/ui";
+import { NostrSnippet } from "../post/wrappers/Nostr";
+
+export default Snippets;
+function Snippets({ post }: { post: SPID }) {
+  return (
+    <ComposerSnippet>
+      <PostSnippet post={post} />
+    </ComposerSnippet>
+  );
+}
+
+export function ComposerSnippet({
+  onClick,
+  children,
+}: {
+  onClick?: any;
+  children: any;
+}) {
+  function onc(e: React.MouseEvent) {
+    e.stopPropagation();
+    onClick();
+  }
+  return (
+    <div className="composer-snippet">
+      <div className="pop-snippet-icon cp" role="link" onClick={onc}></div>
+      {children}
+    </div>
+  );
+}
+function PostSnippet({ post }: { post: SPID }) {
+  if ("trill" in post) return <Quote data={post.trill} nest={0} />;
+  else if ("nostr" in post) return <NostrSnippet {...post.nostr} />;
+  // else if ("twatter" in post)
+  //   return (
+  //     <div id={`composer-${type}`}>
+  //       <Tweet tweet={post.post} quote={true} />
+  //     </div>
+  //   );
+  // else if ("rumors" in post)
+  //   return (
+  //     <div id={`composer-${type}`}>
+  //       <div className="rumor-quote f1">
+  //         <img src={rumorIcon} alt="" />
+  //         <Body poast={post.post} refetch={() => {}} />
+  //         <span>{date_diff(post.post.time, "short")}</span>
+  //       </div>
+  //     </div>
+  //   );
+  else return <></>;
+}
+
+export function ReplySnippet({ post }: { post: SPID }) {
+  if ("trill" in post)
+    return (
+      <div id="reply">
+        <Quote data={post.trill} nest={0} />
+      </div>
+    );
+  else return <div />;
+}
-- 
cgit v1.2.3

