diff --git a/src/app/topics/[id]/DifficultyPage.tsx b/src/app/topics/[id]/DifficultyPage.tsx
index b9517e6..a7fcc46 100644
--- a/src/app/topics/[id]/DifficultyPage.tsx
+++ b/src/app/topics/[id]/DifficultyPage.tsx
@@ -2,8 +2,7 @@
import Link from 'next/link';
import Navigation from '../../components/Navigation';
-import { difficulties, topics } from '../../constants/topics';
-import type { TopicId } from '../../constants/topics';
+import { difficulties } from '../../constants/topics';
const difficultyColors = {
beginner: 'bg-electric-violet', // Pink for Surface Level
diff --git a/src/app/topics/[id]/difficulty/page.tsx b/src/app/topics/[id]/difficulty/page.tsx
deleted file mode 100644
index 0519ecb..0000000
--- a/src/app/topics/[id]/difficulty/page.tsx
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/app/topics/[id]/page.tsx b/src/app/topics/[id]/page.tsx
index 8dc2922..1a17643 100644
--- a/src/app/topics/[id]/page.tsx
+++ b/src/app/topics/[id]/page.tsx
@@ -9,8 +9,9 @@ export function generateStaticParams() {
}));
}
-export default function Difficulty(props: { params: { id: string } }) {
- const topic = topics[props.params.id as TopicId];
-
- return ;
+export default async function Difficulty({ params }: { params: Promise<{ id: string }> }) {
+ const { id } = await params;
+ const topic = topics[id as TopicId];
+
+ return ;
}
\ No newline at end of file
diff --git a/src/app/topics/[id]/questions/[difficulty]/page.tsx b/src/app/topics/[id]/questions/[difficulty]/page.tsx
index ceff5c8..22f3bc7 100644
--- a/src/app/topics/[id]/questions/[difficulty]/page.tsx
+++ b/src/app/topics/[id]/questions/[difficulty]/page.tsx
@@ -13,13 +13,13 @@ export function generateStaticParams() {
);
}
-export default function Questions(props: { params: { id: string; difficulty: string } }) {
- const topic = topics[props.params.id as TopicId];
- const difficulty = props.params.difficulty as Difficulty;
+export default async function Questions({ params }: { params: Promise<{ id: string; difficulty: string }> }) {
+ const { id, difficulty } = await params;
+ const topic = topics[id as TopicId];
- if (!topic || !difficultyNames[difficulty]) {
+ if (!topic || !difficultyNames[difficulty as Difficulty]) {
return null;
}
- return ;
+ return ;
}
\ No newline at end of file