mirror of
https://litchi.icu/ngc2207/judge4c-demo.git
synced 2025-05-18 13:07:49 +00:00
feat: 将所有代码片段展示在首页
This commit is contained in:
parent
6978d3483b
commit
24fdbcdf16
@ -1,3 +1,9 @@
|
||||
export default function HomePage() {
|
||||
return <div>Home Page</div>;
|
||||
import { db } from "@/db";
|
||||
|
||||
export default async function HomePage() {
|
||||
const snippets = await db.snippet.findMany();
|
||||
const renderedSnippets = snippets.map((snippet) => {
|
||||
return <div key={snippet.id}>{snippet.title}</div>;
|
||||
});
|
||||
return <div>{renderedSnippets}</div>;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user