feat: dynamic titles, event footer

This commit is contained in:
Alejandro Gómez
2025-12-11 22:50:09 +01:00
parent b7fbaf5e46
commit 08db0eff5a
9 changed files with 497 additions and 25 deletions

View File

@@ -0,0 +1,100 @@
import {
Book,
Podcast,
FileText,
HelpCircle,
List,
BookOpen,
ExternalLink,
User,
Lock,
Unlock,
Radio,
Rss,
Layout,
Bug,
type LucideIcon,
} from "lucide-react";
/**
* Icon mapping for all commands/apps
* Each command has an icon and optional tooltip description
*/
export interface CommandIcon {
icon: LucideIcon;
description: string;
}
export const COMMAND_ICONS: Record<string, CommandIcon> = {
// Documentation commands
nip: {
icon: Book,
description: "View Nostr Implementation Possibility specification",
},
kind: {
icon: FileText,
description: "View information about a Nostr event kind",
},
kinds: {
icon: List,
description: "Display all supported Nostr event kinds",
},
man: {
icon: BookOpen,
description: "Display manual page for a command",
},
help: {
icon: HelpCircle,
description: "Display general help information",
},
// Nostr commands
req: {
icon: Podcast,
description: "Active subscription to Nostr relays with filters",
},
open: {
icon: ExternalLink,
description: "Open and view a Nostr event",
},
profile: {
icon: User,
description: "View a Nostr user profile",
},
relay: {
icon: Radio,
description: "View relay information and statistics",
},
feed: {
icon: Rss,
description: "View event feed",
},
// Utility commands
encode: {
icon: Lock,
description: "Encode data to NIP-19 format",
},
decode: {
icon: Unlock,
description: "Decode NIP-19 encoded identifiers",
},
// System commands
win: {
icon: Layout,
description: "View all open windows",
},
debug: {
icon: Bug,
description: "Display application state for debugging",
},
};
export function getCommandIcon(command: string): LucideIcon {
return COMMAND_ICONS[command]?.icon || FileText;
}
export function getCommandDescription(command: string): string {
return COMMAND_ICONS[command]?.description || "";
}