fix(lesson): fix lesson modal title

This commit is contained in:
shafin-r
2026-03-10 00:53:08 +06:00
parent 59e601052f
commit a1295a0eb3
2 changed files with 21 additions and 13 deletions

View File

@ -466,12 +466,15 @@ export const Lessons = () => {
const [activeTab, setActiveTab] = useState<"rw" | "math" | "video">("rw");
const [videoSubTab, setVideoSubTab] = useState<VideoSubTab>("rw");
const [selectedLessonId, setSelectedLessonId] = useState<string | null>(null);
const [selectedLessonData, setSelectedLessonData] = useState<{
id: string | null;
name: string | null;
}>({ id: null, name: null });
const [isModalOpen, setIsModalOpen] = useState(false);
const [searchQuery, setSearchQuery] = useState("");
const handleLessonClick = (id: string) => {
setSelectedLessonId(id);
const handleLessonClick = (id: string, name: string) => {
setSelectedLessonData({ id, name });
setIsModalOpen(true);
};
@ -565,7 +568,7 @@ export const Lessons = () => {
<div
key={lesson.id}
className="ls-lesson-row"
onClick={() => handleLessonClick(lesson.id)}
onClick={() => handleLessonClick(lesson.id, lesson.title)}
>
<span className="ls-row-num">
{String(li + 1).padStart(2, "0")}
@ -764,10 +767,10 @@ export const Lessons = () => {
<LessonModal
open={isModalOpen}
lessonId={selectedLessonId}
selectedLessonData={selectedLessonData}
onOpenChange={(open) => {
setIsModalOpen(open);
if (!open) setSelectedLessonId(null);
if (!open) setSelectedLessonData({ id: null, name: null });
}}
/>
</div>