import { nip19 } from 'nostr-tools';
import { useParams } from 'react-router-dom';
import NotFound from './NotFound';
export function NIP19Page() {
const { nip19: identifier } = useParams<{ nip19: string }>();
if (!identifier) {
return ;
}
let decoded;
try {
decoded = nip19.decode(identifier);
} catch {
return ;
}
const { type } = decoded;
switch (type) {
case 'npub':
case 'nprofile':
// AI agent should implement profile view here
return
Profile placeholder
;
case 'note':
// AI agent should implement note view here
return Note placeholder
;
case 'nevent':
// AI agent should implement event view here
return Event placeholder
;
case 'naddr':
// AI agent should implement addressable event view here
return Addressable event placeholder
;
default:
return ;
}
}