forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFloatingControlBarReceiptCard.swift
More file actions
41 lines (40 loc) · 1.45 KB
/
Copy pathFloatingControlBarReceiptCard.swift
File metadata and controls
41 lines (40 loc) · 1.45 KB
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
34
35
36
37
38
39
40
41
import OmiTheme
import SwiftUI
extension FloatingControlBarView {
/// A proposed task surfaced while listening (I1): a suggestion the user must
/// accept, not a save receipt. The wire text is the encoded
/// `SuggestedTaskChatCard`; the pill shows the human description and offers
/// Review (there is no Undo — nothing was written). Auto-collapses.
@ViewBuilder
func notchReceiptCard(_ notification: FloatingBarNotification) -> some View {
let card = SuggestedTaskChatCard.parse(notification.title)
HStack(spacing: 10) {
Image(systemName: "checklist")
.scaledFont(size: 12.5)
.foregroundColor(NotchGlass.primary)
VStack(alignment: .leading, spacing: 1) {
Text("Suggested task")
.scaledFont(size: 10)
.foregroundColor(NotchGlass.ink(.w55))
Text(card?.description ?? notification.title)
.scaledFont(size: 12.5)
.foregroundColor(NotchGlass.primary)
.lineLimit(2)
}
Spacer(minLength: 8)
Button {
NotchMomentsCoordinator.shared.reviewLastReceipt()
FloatingControlBarManager.shared.dismissCurrentNotification()
} label: {
Text("Review")
.scaledFont(size: 11.5)
.foregroundColor(NotchGlass.primary)
.underline()
}
.buttonStyle(.plain)
}
.padding(.horizontal, OmiSpacing.md)
.padding(.vertical, OmiSpacing.sm)
.frame(maxWidth: .infinity, alignment: .leading)
}
}