import React from 'react'; import { FeedEntry } from '../types'; import { estimateReadingTime } from '../utils'; import { X, Star, CheckCircle2, ExternalLink, Share2, Clock, User as UserIcon, } from 'lucide-react'; interface ArticleModalProps { entry: FeedEntry; onClose: () => void; onToggleStar: (e?: React.MouseEvent) => void; onToggleRead: (e?: React.MouseEvent) => void; } export const ArticleModal: React.FC = ({ entry, onClose, onToggleStar, onToggleRead, }) => { const shareUrl = `${window.location.origin}/share/${entry.share_uuid || entry.id}.html`; const handleScroll = (e: React.UIEvent) => { if (entry.is_read) return; const { scrollTop, scrollHeight, clientHeight } = e.currentTarget; if (scrollHeight <= clientHeight + 40) return; const scrollProgress = (scrollTop + clientHeight) / scrollHeight; if (scrollProgress >= 0.9) { onToggleRead(); } }; return (
e.stopPropagation()} > {/* Top Header Actions */}
{entry.feed_title}
{/* Article Scroll Body */}
{entry.feed_title} • {' '} {new Date(entry.published_at).toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric', })} • {estimateReadingTime(entry.content || entry.raw_content)} {entry.author && ( <> • {entry.author} )}

{entry.title}

); };