File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -411,9 +411,17 @@ import type { Course } from "../../types/schedule";
411411 }
412412 if (speakerDescriptionEl) {
413413 speakerDescriptionEl.style.display = "block";
414- if (course.expo && Array.isArray(course.expo) && course.expo.length > 0) {
415- const boothList = course.expo.map(booth => `<li>${booth}</li>`).join("");
416- speakerDescriptionEl.innerHTML = `<ul style="list-style-type: disc; padding-left: 1.5rem; line-height: 1.6;">${boothList}</ul>`;
414+ speakerDescriptionEl.innerHTML = "";
415+
416+ // Get speaker data from the speakers array using speaker IDs
417+ const speakers = course.speakers
418+ ?.map(speakerId => scheduleData.speakers.find(speaker => speaker.id === speakerId))
419+ .filter(speaker => speaker !== undefined) as Speaker[];
420+
421+ const speakersWithDesc = speakers?.filter(speaker => speaker.zh.bio && speaker.zh.bio.trim() !== "") || [];
422+
423+ if (speakersWithDesc.length > 0) {
424+ speakerDescriptionEl.innerHTML = renderMarkdown(speakersWithDesc[0].zh.bio);
417425 } else {
418426 speakerDescriptionEl.innerHTML = "暫無攤位資訊";
419427 }
You can’t perform that action at this time.
0 commit comments