refactor: 优化参与者列表生成逻辑
- 在 `MeetingPreviewView.tsx` 中更新 `participants` 的生成逻辑,当 `meeting?.participants` 为空时,从 `transcripts` 中提取唯一发言人并生成列表dev_na
parent
236176d5ff
commit
c0d2dcce3d
|
|
@ -180,7 +180,19 @@ export default function MeetingPreviewView({
|
|||
() => buildMeetingAnalysis(meeting?.analysis, meeting?.summaryContent, meeting?.tags || ""),
|
||||
[meeting?.analysis, meeting?.summaryContent, meeting?.tags],
|
||||
);
|
||||
const participants = useMemo(() => splitDisplayItems(meeting?.participants), [meeting?.participants]);
|
||||
const participants = useMemo(() => {
|
||||
const list = splitDisplayItems(meeting?.participants);
|
||||
if (list.length > 0) return list;
|
||||
|
||||
const uniqueSpeakers = new Set<string>();
|
||||
for (const item of transcripts) {
|
||||
const speakerKey = item.speakerName || item.speakerLabel || item.speakerId;
|
||||
if (speakerKey) {
|
||||
uniqueSpeakers.add(speakerKey);
|
||||
}
|
||||
}
|
||||
return Array.from(uniqueSpeakers);
|
||||
}, [meeting?.participants, transcripts]);
|
||||
const tags = useMemo(() => splitDisplayItems(meeting?.tags), [meeting?.tags]);
|
||||
const playbackAudioUrl = useMemo(() => resolveMeetingPlaybackAudioUrl(meeting), [meeting]);
|
||||
const statusMeta = STATUS_META[meeting?.status || 0] || {
|
||||
|
|
|
|||
Loading…
Reference in New Issue