diff --git a/src/components/KindsViewer.tsx b/src/components/KindsViewer.tsx index 529f781..bd51685 100644 --- a/src/components/KindsViewer.tsx +++ b/src/components/KindsViewer.tsx @@ -1,24 +1,9 @@ import { getKindInfo } from "@/constants/kinds"; +import { kindRenderers } from "./nostr/kinds"; import Command from "./Command"; -// Supported kinds with rich renderers -const SUPPORTED_KINDS = [ - 0, // Profile Metadata - 1, // Short Text Note - 3, // Contact List - 6, // Repost - 7, // Reaction - 20, // Picture (NIP-68) - 21, // Video Event (NIP-71) - 22, // Short Video (NIP-71) - 1063, // File Metadata (NIP-94) - 1111, // Post - 9735, // Zap Receipt - 9802, // Highlight - 10002, // Relay List Metadata (NIP-65) - 30023, // Long-form Article - 39701, // Web Bookmarks (NIP-B0) -]; +// Dynamically derive supported kinds from renderer registry +const SUPPORTED_KINDS = Object.keys(kindRenderers).map(Number); /** * KindsViewer - System introspection command diff --git a/src/components/nostr/kinds/index.tsx b/src/components/nostr/kinds/index.tsx index 2cddbc3..3aa61ea 100644 --- a/src/components/nostr/kinds/index.tsx +++ b/src/components/nostr/kinds/index.tsx @@ -69,6 +69,11 @@ export function KindRenderer({ return ; } +/** + * Export kind renderers registry for dynamic kind detection + */ +export { kindRenderers }; + /** * Export individual renderers and base components for reuse */