mirror of
https://github.com/dergigi/boris.git
synced 2026-01-07 17:04:34 +01:00
feat: add offline highlight creation with local relay tracking
- Add relay tracking to Highlight type (publishedRelays, isLocalOnly fields) - Create utility functions to identify local relays (localhost/127.0.0.1) - Update highlight creation service to track which relays received the event - Detect when highlights are only on local relays and mark accordingly - Add visual indicator in UI for local-only highlights with amber badge - Enable immediate display of highlights created offline - Ensure highlights work even when only local relay is available
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useRef } from 'react'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import { faQuoteLeft, faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons'
|
||||
import { faQuoteLeft, faExternalLinkAlt, faHouseSignal } from '@fortawesome/free-solid-svg-icons'
|
||||
import { Highlight } from '../types/highlights'
|
||||
import { formatDistanceToNow } from 'date-fns'
|
||||
import { useEventModel } from 'applesauce-react/hooks'
|
||||
@@ -91,6 +91,16 @@ export const HighlightItem: React.FC<HighlightItemProps> = ({ highlight, onSelec
|
||||
{formatDistanceToNow(new Date(highlight.created_at * 1000), { addSuffix: true })}
|
||||
</span>
|
||||
|
||||
{highlight.isLocalOnly && (
|
||||
<>
|
||||
<span className="highlight-meta-separator">•</span>
|
||||
<span className="highlight-local-indicator" title="This highlight is only stored on your local relay">
|
||||
<FontAwesomeIcon icon={faHouseSignal} />
|
||||
<span className="highlight-local-text">Local</span>
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
|
||||
{sourceLink && (
|
||||
<a
|
||||
href={sourceLink}
|
||||
|
||||
Reference in New Issue
Block a user