This commit is contained in:
2026-07-10 22:38:58 +08:00
commit 34c7cf34fd
56 changed files with 16425 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import { useNewsStore } from "@/lib/database";
export default async function NewsPage() {
const newsList = await useNewsStore.findAsync({});
return (
<div className="flex flex-col gap-8">
<h1 className="text-2xl font-bold"></h1>
<div className="grid gap-4">
{newsList.length > 0 ? (
newsList.map((item: any) => (
<div
key={item._id}
className="p-4 border rounded-lg shadow-sm hover:shadow-md transition-shadow"
>
<h2 className="text-lg font-semibold">{item.title || "无标题"}</h2>
<p className="text-gray-500 text-sm mt-2">{item.content || "暂无内容..."}</p>
<div className="text-xs text-gray-400 mt-4">
: {item.createdAt ? new Date(item.createdAt).toLocaleDateString() : "未知"}
</div>
</div>
))
) : (
<p className="text-muted-foreground"></p>
)}
</div>
</div>
);
}