feat: add Educational Resource (kind 30142) with AMB metadata support#260
feat: add Educational Resource (kind 30142) with AMB metadata support#260sroertgen wants to merge 1 commit intopurrgrammer:mainfrom
Conversation
- Add feed and detail renderers for AMB Educational Resource events - Add amb-helpers library with cached helper functions and tests - Handle broken thumbnail images with BookOpen placeholder fallback - Surface primary resource URL prominently in both renderers (bookmark-style) - Register kind 30142 with GraduationCap icon in kind registry - Link NIP-AMB badge to community NIP event (kind 30817)
|
@sroertgen is attempting to deploy a commit to the bandarra-protonmailc's Team Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
purrgrammer
left a comment
There was a problem hiding this comment.
great job, looks solid overall. some minor nits and we can go ahead and merge it.
| import { UserName } from "@/components/nostr/UserName"; | ||
| import { MediaEmbed } from "../MediaEmbed"; | ||
|
|
||
| interface Kind30142DetailRendererProps { |
There was a problem hiding this comment.
we can probably use a more human friendly name for these components, I started with kindxxxrenderer convention but moved away from it
| <div className="grid grid-cols-2 gap-3 py-2 text-sm"> | ||
| {language && ( | ||
| <MetadataField label="Language"> | ||
| <span className="font-mono">{language}</span> |
There was a problem hiding this comment.
we could localize language names with Intl.DisplayName if these are language coded
| {licenseId && ( | ||
| <MetadataField label="License"> | ||
| {licenseId.startsWith("http") ? ( | ||
| <a |
There was a problem hiding this comment.
I think we have a component for links but I might be wrong.
| </MetadataField> | ||
| )} | ||
|
|
||
| {dateCreated && ( |
There was a problem hiding this comment.
localizing dated would be nice
| <Section title="Keywords"> | ||
| <div className="flex flex-wrap gap-1.5"> | ||
| {keywords.map((kw) => ( | ||
| <Label key={kw}>#{kw}</Label> |
There was a problem hiding this comment.
we can leave out the # symbol
| <BaseEventContainer event={event}> | ||
| <div className="flex gap-3"> | ||
| {/* Thumbnail */} | ||
| {image && !imgError && ( |
There was a problem hiding this comment.
I'd rather not have images in feed renderers except for very specific kinds like emoji and badged
| {keywords.length > 0 && ( | ||
| <div className="flex flex-wrap gap-1"> | ||
| {keywords.map((kw) => ( | ||
| <Label key={kw} className="text-primary/80"> |
| const communityNip = getCommunityNipForNipId(nipNumber); | ||
|
|
||
| const openNIP = () => { | ||
| if (communityNip) { |
There was a problem hiding this comment.
nice, reminder to self to review community kinds and add a pointer to them
| // ============================================================================ | ||
|
|
||
| /** Get base language code from browser (e.g., "de", "en") */ | ||
| function getBrowserLanguage(): string { |
There was a problem hiding this comment.
we have some utilities for locale detection, maybe can reuse those
Based on NIP-AMB I implemented support for rendering kind 30142 events.
with ExternalLink icon), type/language/level badges, description, keywords, and creator attribution
(language, level, resource type, audience, license, dates), creators, subjects, keywords, references, and related resources
Reference: https://jumble.social/notes/nevent1qvzqqqqqqypzq8zl7092ekzzcqwu4rehsgcmzesh29kjznd8t3aw4wlfu8h7ns8kqyt8wumn8ghj7un9d3shjtnddaehgu3wwp6kytcprdmhxue69uhhg6r9vehhyetnwshxummnw3erztnrdakj7qpq5nc2ycgst5qaccus3nq5pt3hzrldzrazjaclaj5ghyq6zz65yqxst777h9
🤙