forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTranscriptDetailView.swift
More file actions
33 lines (30 loc) · 915 Bytes
/
Copy pathTranscriptDetailView.swift
File metadata and controls
33 lines (30 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import OmiTheme
import SwiftUI
/// Detailed transcript view showing all segments as chat bubbles
struct TranscriptDetailView: View {
let segments: [TranscriptSegment]
var peopleById: [String: Person] = [:]
var onSpeakerTapped: ((TranscriptSegment) -> Void)? = nil
var body: some View {
ScrollView {
LazyVStack(spacing: OmiSpacing.md) {
ForEach(segments) { segment in
SpeakerBubbleView(
segment: segment,
isUser: segment.isUser,
personName: segment.personId.flatMap { peopleById[$0]?.name },
onSpeakerTapped: segment.isUser ? nil : (onSpeakerTapped != nil ? { onSpeakerTapped?(segment) } : nil)
)
}
}
.padding(OmiSpacing.lg)
}
}
}
#if canImport(PreviewsMacros)
#Preview {
TranscriptDetailView(segments: [])
.frame(width: 400, height: 400)
.background(Ink.rowFill)
}
#endif