From cba29e6aae637b04ff6eaf28f74bc15b6242b9ea Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Mon, 16 Feb 2026 19:37:50 -0800 Subject: Remove legacy V2 React frontend and update build/test scripts to focus on Vanilla JS (V3) --- frontend/src/components/FeedItem.tsx | 90 ------------------------------------ 1 file changed, 90 deletions(-) delete mode 100644 frontend/src/components/FeedItem.tsx (limited to 'frontend/src/components/FeedItem.tsx') diff --git a/frontend/src/components/FeedItem.tsx b/frontend/src/components/FeedItem.tsx deleted file mode 100644 index 865c080..0000000 --- a/frontend/src/components/FeedItem.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import { useState, memo } from 'react'; -import type { Item } from '../types'; -import './FeedItem.css'; - -import { apiFetch } from '../utils'; - -interface FeedItemProps { - item: Item; - onToggleStar?: (item: Item) => void; - onUpdate?: (item: Item) => void; -} - -const FeedItem = memo(function FeedItem({ item, onToggleStar, onUpdate }: FeedItemProps) { - const [loading, setLoading] = useState(false); - - // We rely on props.item for data. - // If we fetch full content, we notify the parent via onUpdate. - - const handleToggleStar = (e: React.MouseEvent) => { - e.stopPropagation(); - if (onToggleStar) { - onToggleStar(item); - } else { - // Fallback if no handler passed (backward compat or isolated usage) - // But really we should rely on parent. - // For now, let's keep the optimistic local update logic if we were standalone, - // but since we are optimizing, we assume parent handles it. - } - }; - - const loadFullContent = (e: React.MouseEvent) => { - e.stopPropagation(); - setLoading(true); - apiFetch(`/api/item/${item._id}`) - .then((res) => { - if (!res.ok) throw new Error('Failed to fetch full content'); - return res.json(); - }) - .then((data) => { - // Merge the new data (full_content) into the item and notify parent - const newItem = { ...item, ...data }; - if (onUpdate) { - onUpdate(newItem); - } - setLoading(false); - }) - .catch((err) => { - console.error('Error fetching full content:', err); - setLoading(false); - }); - }; - - return ( -
  • -
    - - {item.title || '(No Title)'} - - -
    -
    - - {new Date(item.publish_date).toLocaleDateString()} - {item.feed_title && ` - ${item.feed_title}`} - -
    - {!item.full_content && ( - - )} -
    -
    - {(item.full_content || item.description) && ( -
    - )} -
  • - ); -}); - -export default FeedItem; -- cgit v1.2.3