diff --git a/src/app/news/page.tsx b/src/app/news/page.tsx new file mode 100644 index 0000000..49191f7 --- /dev/null +++ b/src/app/news/page.tsx @@ -0,0 +1,93 @@ +'use client'; + +import { Search } from 'lucide-react'; +import { useState } from 'react'; +import Image from 'next/image'; +import Link from 'next/link'; + +// TODO: add source with little profile pic of cnbc, bloomberg, etc. + +export interface News { + id: string; + title: string; + summary: string; +} + +const mockNewsData: News[] = [ + { + "id": "_TSLA2025OUTLOOK", + "title": "Tesla faces market challenges but bets on AI and autonomy", + "summary": "Tesla's stock has been volatile, currently at $279.17, after a 40% decline from recent highs. Revenue growth remains stagnant, and U.S. EV market share has dropped to 44%. Elon Musk's political engagements may be affecting brand perception, with Tesla registrations in Germany falling 76%. Despite challenges, Tesla is investing in AI, robotics, and autonomous driving, aiming to launch Full Self-Driving in Austin by June 2025 and the Cybercab ride-hailing vehicle by 2026. Analysts are divided—Morgan Stanley sees growth potential, while Bank of America has lowered its price target." + } + , + { id: '_4dn88SBPLM1', title: 'Tech giants announce a new AI breakthrough', summary: 'Tech giants announce a new AI breakthrough.' }, + { id: '_4dn88SBPLM2', title: 'Sports update: Local team secures championship win.', summary: 'Sports update: Local team secures championship win.' }, + { id: '_4dn88SBPLM3', title: 'Market trends: Stocks surge after latest reports.', summary: 'Market trends: Stocks surge after latest reports.' }, + { id: '_4dn88SBPLM4', title: 'Entertainment: Upcoming movies and releases for this year.', summary: 'Entertainment: Upcoming movies and releases for this year.' }, +]; + +const NewsPage = () => { + const [news] = useState(mockNewsData); + const [expanded, setExpanded] = useState<{ [key: string]: boolean }>({}); + + const toggleSummary = (id: string) => { + setExpanded((prev) => ({ ...prev, [id]: !prev[id] })); + }; + + return ( +
+
+
+ +

Latest News

+
+
+
+ +
+ {news.map((item) => ( +
+ {/* Construct YouTube URL dynamically */} + +
+ {/* Thumbnail on the Left */} +
+ + placeholder + +
+ + {/* Text on the Right */} +
+

{item.title}

+ + {/* Sliced Summary */} +

+ {expanded[item.id] ? item.summary : `${item.summary.slice(0, 100)}...`} +

+ + {/* Toggle Button */} + +
+
+
+ ))} +
+
+ ); +}; + +export default NewsPage; \ No newline at end of file