Skip to content

Commit b2725f0

Browse files
committed
Refactor CourseNavigation component by removing the unused ModuleData interface. Update MarkdownRenderer to ensure proper handling of architecture diagram images by checking the type of the src variable.
1 parent adf6bed commit b2725f0

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

components/course-navigation.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ interface LessonItem {
1212
href: string;
1313
}
1414

15-
interface ModuleData {
16-
title: string;
17-
titleZh: string;
18-
icon: React.ReactNode;
19-
lessons: LessonItem[];
20-
}
21-
2215
export function CourseNavigation() {
2316
const { language } = useLanguage();
2417
const pathname = usePathname();

components/markdown-renderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export function MarkdownRenderer({ content }: MarkdownRendererProps) {
107107
if (!src) return null;
108108

109109
// Check if this is the architecture diagram that should be smaller
110-
const isArchitectureDiagram = alt?.includes('Architecture') || src?.includes('architecture');
110+
const isArchitectureDiagram = alt?.includes('Architecture') || (typeof src === 'string' && src.includes('architecture'));
111111
const imageClassName = isArchitectureDiagram ? "w-1/2 h-auto mx-auto" : "w-full h-auto";
112112

113113
// Handle external images

0 commit comments

Comments
 (0)