diff --git a/src/components/KindRenderer.tsx b/src/components/KindRenderer.tsx index 6ea2481..46c175e 100644 --- a/src/components/KindRenderer.tsx +++ b/src/components/KindRenderer.tsx @@ -1,6 +1,9 @@ import { getKindInfo } from "@/constants/kinds"; import { kinds } from "nostr-tools"; import { NIPBadge } from "./NIPBadge"; +import { Copy, CopyCheck } from "lucide-react"; +import { Button } from "./ui/button"; +import { useCopy } from "@/hooks/useCopy"; // NIP-01 Kind ranges const REPLACEABLE_START = 10000; @@ -15,6 +18,11 @@ export default function KindRenderer({ kind }: { kind: number }) { const Icon = kindInfo?.icon; const category = getKindCategory(kind); const eventType = getEventType(kind); + const { copy, copied } = useCopy(); + + function copyKind() { + copy(String(kind)); + } if (!kindInfo) { return ( @@ -47,21 +55,31 @@ export default function KindRenderer({ kind }: { kind: number }) { {/* Details Grid */}
Kind Number
- {kind} - +
+ {kind} + +
Category
{category}
-
Event Type
{eventType}
-
Storage
{kind >= EPHEMERAL_START && kind < EPHEMERAL_END ? "Not stored (ephemeral)" : "Stored by relays"}
- {kind >= PARAMETERIZED_REPLACEABLE_START && kind < PARAMETERIZED_REPLACEABLE_END && ( <> @@ -69,7 +87,6 @@ export default function KindRenderer({ kind }: { kind: number }) { d-tag )} - {kindInfo.nip && ( <>
Defined in
diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index 775d380..5795b77 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -19,6 +19,7 @@ const buttonVariants = cva( "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80", ghost: "hover:bg-accent hover:text-accent-foreground", link: "text-primary underline-offset-4 hover:underline", + copy: "text-muted-foreground cursor-copy", }, size: { default: "h-9 px-4 py-2",