Skip to content

Commit aba69fd

Browse files
committed
PR comments
1 parent 8ff8e41 commit aba69fd

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
"use client";
2+
import { type Session } from "next-auth";
3+
import { notFound } from "next/navigation";
4+
import { isFlagEnabled, FEATURE_FLAGS } from "@/utils/flags";
5+
import { mockContentList, mockVideoSrc } from "../../mock";
6+
7+
const Content = ({ session }: { session: Session | null }) => {
8+
const flagEnabled = isFlagEnabled(FEATURE_FLAGS.COURSE_VIDEO);
9+
10+
if (!flagEnabled) {
11+
notFound();
12+
}
13+
14+
return (
15+
<div className="flex w-full flex-grow flex-col">
16+
<div className="w-full lg:grid lg:grid-cols-12 ">
17+
{/* Video container */}
18+
<div className="col-span-9 max-h-[60vh]">
19+
<div className="flex h-full items-center justify-center">
20+
<video
21+
className="h-[60vh] w-[100vh] lg:h-full"
22+
src={mockVideoSrc}
23+
controls
24+
>
25+
<track
26+
kind="captions"
27+
src={mockVideoSrc}
28+
srcLang="en"
29+
label="English"
30+
/>
31+
Your browser does not support the video tag.
32+
</video>
33+
</div>
34+
</div>
35+
36+
{/* Sidebar */}
37+
<div className="col-span-3 flex h-[60vh] w-full flex-col overflow-auto">
38+
<ul className="p-4">
39+
{mockContentList && mockContentList.length > 0 ? (
40+
mockContentList.map((item, index) => (
41+
<li key={index} className="mb-4 rounded bg-gray-100 p-2">
42+
<h3 className="font-bold">{item.title}</h3>
43+
<p className="text-sm text-gray-600">{item.description}</p>
44+
</li>
45+
))
46+
) : (
47+
<li className="text-center text-gray-500">
48+
No content available
49+
</li>
50+
)}
51+
</ul>
52+
</div>
53+
</div>
54+
</div>
55+
);
56+
};
57+
58+
export default Content;

0 commit comments

Comments
 (0)