change the npm to yarn and update the json

This commit is contained in:
Yifei Hu 2024-07-10 11:00:11 +08:00
parent 78738c9282
commit effd1d38d0
19 changed files with 4111 additions and 6 deletions

View file

@ -0,0 +1,35 @@
import React from "react";
import ContextItem from "./ContextItem";
interface NewsDetailProps {
news: {
title: string;
sections: {
title: string;
content: string;
context: any[];
}[];
};
}
const NewsDetail: React.FC<NewsDetailProps> = ({ news }) => {
return (
<article className="prose lg:prose-xl">
<h1>{news.title}</h1>
{news.sections.map((section, index) => (
<section key={index}>
<h2>{section.title}</h2>
<p>{section.content}</p>
<div className="mt-4">
<h3>Related Context:</h3>
{section.context.map((item, i) => (
<ContextItem key={i} item={item} />
))}
</div>
</section>
))}
</article>
);
};
export default NewsDetail;