import { AppTile } from '#/components/atoms/app-tile.jsx'; import { ListRow } from '#/components/molecules/list-row.jsx'; import { article, nsidDomain, recordNoun, timeAgo } from '#/lib/format.js'; const VERB = { create: 'Added', update: 'Updated', delete: 'Removed', }; /** * A feed of record changes, newest first. Every row links to that change's * point-in-time snapshot — deletes included, since the snapshot recovers what * the record was. */ export function ActivityList({ events, recordHref, onNavigate }) { return (
{events.map((event) => { const label = VERB[event.action] || event.action; // Read the record type in plain language ("a post"), not its NSID, and // let the app show once below instead of repeating its domain here. const noun = recordNoun(event.collection); const href = recordHref?.(event.collection, event.rkey, event.seq); return ( } title={ {label} {article(noun)}{' '} {noun} } description={nsidDomain(event.collection)} actions={ {timeAgo(event.time)} } /> ); })}
); }