diff --git a/src/components/CourseNotes/CourseNoteCard.tsx b/src/components/CourseNotes/CourseNoteCard.tsx new file mode 100644 index 000000000..fc5f60f31 --- /dev/null +++ b/src/components/CourseNotes/CourseNoteCard.tsx @@ -0,0 +1,45 @@ +import { useMemo } from 'react'; +import { markdownToHtml } from '../../lib/markdown'; + +type CourseNoteCardProps = { + courseId: string; + chapterId: string; + chapterTitle: string; + + lessonId: string; + lessonTitle: string; + + content: string; +}; + +export function CourseNoteCard(props: CourseNoteCardProps) { + const { chapterTitle, lessonTitle, content, courseId, chapterId, lessonId } = + props; + + const markdownHTML = useMemo(() => { + const html = markdownToHtml(content, false); + // FIXME: Sanitize html before returning + + return html; + }, [content]); + + return ( +
+
+ + {chapterTitle} + + / + + {lessonTitle} + +
+ +
+
+ ); +}