-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathChatPanelInputArea.swift
More file actions
41 lines (38 loc) · 1.14 KB
/
ChatPanelInputArea.swift
File metadata and controls
41 lines (38 loc) · 1.14 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 SwiftUI
import ComposableArchitecture
struct ChatPanelInputArea: View {
let chat: StoreOf<Chat>
let r: Double
let editorMode: Chat.EditorMode
@FocusState var focusedField: Chat.State.Field?
var body: some View {
HStack {
InputAreaTextEditor(chat: chat, r: r, focusedField: $focusedField, editorMode: editorMode)
}
.background(Color.clear)
}
@MainActor
var clearButton: some View {
Button(action: {
chat.send(.clearButtonTap)
}) {
Group {
if #available(macOS 13.0, *) {
Image(systemName: "eraser.line.dashed.fill")
.scaledFont(.body)
} else {
Image(systemName: "trash.fill")
.scaledFont(.body)
}
}
.padding(6)
.background {
Circle().fill(Color(nsColor: .controlBackgroundColor))
}
.overlay {
Circle().stroke(Color(nsColor: .controlColor), lineWidth: 1)
}
}
.buttonStyle(.plain)
}
}