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

(limited to 'gui/src/components/Sigil.tsx')

diff --git a/gui/src/components/Sigil.tsx b/gui/src/components/Sigil.tsx
new file mode 100644
index 0000000..cbc2e57
--- /dev/null
+++ b/gui/src/components/Sigil.tsx
@@ -0,0 +1,50 @@
+import Icon from "@/components/Icon";
+import { auraToHex } from "@/logic/utils";
+import { isValidPatp } from "urbit-ob";
+import { sigil } from "urbit-sigils";
+import { reactRenderer } from "urbit-sigils";
+
+interface SigilProps {
+  patp: string;
+  size: number;
+  bg?: string;
+  fg?: string;
+}
+
+const Sigil = (props: SigilProps) => {
+  const bg = props.bg ? auraToHex(props.bg) : "var(--color-background)";
+  const fg = props.fg ? auraToHex(props.fg) : "var(--color-primary)";
+  if (props.patp.length > 28)
+    return (
+      <Icon
+        name="comet"
+        size={props.size}
+        className="comet-icon"
+      />
+    );
+  else if (props.patp.length > 15)
+    // moons
+    return (
+      <>
+        {sigil({
+          patp: props.patp.substring(props.patp.length - 13),
+          renderer: reactRenderer,
+          size: props.size,
+          colors: ["grey", "white"],
+        })}
+      </>
+    );
+  else
+    return (
+      <>
+        {sigil({
+          patp: props.patp,
+          renderer: reactRenderer,
+          size: props.size,
+          colors: [bg, fg],
+        })}
+      </>
+    );
+};
+
+export default Sigil;
-- 
cgit v1.2.3

