mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-06-06 02:31:13 +02:00
refactor: dynamically derive supported kinds from renderer registry
This commit is contained in:
@@ -1,24 +1,9 @@
|
|||||||
import { getKindInfo } from "@/constants/kinds";
|
import { getKindInfo } from "@/constants/kinds";
|
||||||
|
import { kindRenderers } from "./nostr/kinds";
|
||||||
import Command from "./Command";
|
import Command from "./Command";
|
||||||
|
|
||||||
// Supported kinds with rich renderers
|
// Dynamically derive supported kinds from renderer registry
|
||||||
const SUPPORTED_KINDS = [
|
const SUPPORTED_KINDS = Object.keys(kindRenderers).map(Number);
|
||||||
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)
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* KindsViewer - System introspection command
|
* KindsViewer - System introspection command
|
||||||
|
|||||||
@@ -69,6 +69,11 @@ export function KindRenderer({
|
|||||||
return <Renderer event={event} depth={depth} />;
|
return <Renderer event={event} depth={depth} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Export kind renderers registry for dynamic kind detection
|
||||||
|
*/
|
||||||
|
export { kindRenderers };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export individual renderers and base components for reuse
|
* Export individual renderers and base components for reuse
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user