-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathChatBotFAQView.swift
More file actions
80 lines (72 loc) · 2.69 KB
/
ChatBotFAQView.swift
File metadata and controls
80 lines (72 loc) · 2.69 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//
// FAQView 2.swift
// iCo
//
// Created by 강대훈 on 10/1/25.
//
import SwiftUI
struct ChatBotFAQView: View {
@Environment(\.colorScheme) var colorScheme
@ObservedObject var viewModel: ChatBotViewModel
var body: some View {
HStack {
VStack {
Image("logo")
.renderingMode(.template)
.resizable()
.scaledToFit()
.frame(width: 34)
.foregroundColor(colorScheme == .light ? .iCoAccent : .iCoLabel)
.opacity(0.8)
.padding(12)
.overlay {
Circle()
.strokeBorder(.accentGradient, lineWidth: 0.5)
}
.background {
Circle()
.fill(.iCoBackgroundBlue)
}
Spacer()
}
Group {
VStack(spacing: 15) {
HStack {
Text("안녕하세요, 아이코 챗봇입니다.\n궁금하신 내용을 선택해주세요.")
.font(.ico17)
Spacer()
}
ForEach(ChatBotFAQ.allCases) { faq in
Button {
Task { await viewModel.sendMessage(message: faq.rawValue) }
} label: {
Text(faq.rawValue)
}
.frame(maxWidth: .infinity)
.padding(.vertical, 10)
.font(.ico16)
.background(.iCoBackgroundAccent)
.clipShape(RoundedRectangle(cornerRadius: 15))
.overlay(RoundedRectangle(cornerRadius: 15).strokeBorder(.accentGradient, lineWidth: 0.5))
.disabled(viewModel.isStreaming)
}
}
}
.foregroundStyle(.iCoLabel)
.font(.ico16)
.lineSpacing(6)
.padding(.vertical, 15)
.padding(.horizontal, 18)
.background {
UnevenRoundedRectangle(bottomLeadingRadius: 16, bottomTrailingRadius: 16, topTrailingRadius: 16)
.fill(.iCoBackgroundBlue)
}
.overlay {
UnevenRoundedRectangle(bottomLeadingRadius: 16, bottomTrailingRadius: 16, topTrailingRadius: 16)
.strokeBorder(.accentGradient, lineWidth: 0.5)
}
.frame(maxWidth: 300, alignment: .leading)
Spacer()
}
}
}