Skip to content

Commit 08d14cf

Browse files
committed
Create framework for content page
1 parent 7ef2683 commit 08d14cf

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

  • main/src/app/[roomId]/contents/[contentId]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { db } from "@/db/db";
2+
import { contentsTable } from "@/db/schema";
3+
import { and, eq } from "drizzle-orm";
4+
5+
export default async function ContentPage({
6+
params,
7+
}: {
8+
params: Promise<{ roomId: string; contentId: string }>;
9+
}) {
10+
const { contentId } = await params;
11+
const content = (
12+
await db
13+
.select()
14+
.from(contentsTable)
15+
.where(and(eq(contentsTable.id, contentId), eq(contentsTable.status, "available")))
16+
).at(0);
17+
if (!content) {
18+
return <div>コンテンツが存在しません</div>;
19+
}
20+
21+
return (
22+
<div>
23+
{/* biome-ignore lint/a11y/useMediaCaption: <explanation> */}
24+
<video />
25+
<div>
26+
<div>
27+
<span>{content.title}</span>
28+
</div>
29+
<span>{content.description}</span>
30+
</div>
31+
</div>
32+
);
33+
}

0 commit comments

Comments
 (0)