import React from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { IndividualBookmark } from '../../types/bookmarks' import { formatDate } from '../../utils/bookmarkUtils' import ContentWithResolvedProfiles from '../ContentWithResolvedProfiles' import { IconGetter } from './shared' import { useImageCache } from '../../hooks/useImageCache' import { UserSettings } from '../../services/settingsService' import { getProfileUrl, getEventUrl } from '../../config/nostrGateways' interface LargeViewProps { bookmark: IndividualBookmark index: number hasUrls: boolean extractedUrls: string[] onSelectUrl?: (url: string, bookmark?: { id: string; kind: number; tags: string[][]; pubkey: string }) => void getIconForUrlType: IconGetter firstUrlClassification: { buttonText: string } | null previewImage: string | null authorNpub: string eventNevent?: string getAuthorDisplayName: () => string handleReadNow: (e: React.MouseEvent) => void articleSummary?: string settings?: UserSettings } export const LargeView: React.FC = ({ bookmark, index, hasUrls, extractedUrls, onSelectUrl, getIconForUrlType, firstUrlClassification, previewImage, authorNpub, eventNevent, getAuthorDisplayName, handleReadNow, articleSummary, settings }) => { const cachedImage = useImageCache(previewImage || undefined, settings) const isArticle = bookmark.kind === 30023 return (
{(hasUrls || (isArticle && cachedImage)) && (
{ if (isArticle) { handleReadNow({ preventDefault: () => {} } as React.MouseEvent) } else { onSelectUrl?.(extractedUrls[0]) } }} style={cachedImage ? { backgroundImage: `url(${cachedImage})` } : undefined} > {!previewImage && hasUrls && (
)}
)}
{isArticle && articleSummary ? (
) : bookmark.content && (
)}
{getAuthorDisplayName()} {eventNevent && ( {formatDate(bookmark.created_at)} )} {(hasUrls && firstUrlClassification) || isArticle ? ( ) : null}
) }