import React from 'react'; import { mockNewsData } from './NewsData'; // 导入新闻数据 import { mockNewsTitleData } from './NewsData'; // 导入新闻标题数据 interface NewsProps { title?: string; description?: string; time?: string; type?: string; url?: string; } interface NewsTitle { id: string; name: string; } const NewsItem: React.FC = ({ title = '', time = '', url = '' }) => { return (
url && window.open(url)} className="flex items-center justify-between hover:text-blue-600 cursor-pointer transition duration-300 ease-in-out" >

{title}

{time}

); }; // 使用新闻数据渲染列表 const NewsList: React.FC = () => { return (
{/* 科技新闻 */}

科技新闻

    {mockNewsData.map((news) => ( ))}
{/* 社会新闻 */}

社会新闻

    {mockNewsData.map((news, index) => ( ))}
); }; export default NewsList;