forked from intitni/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeiumChatView.swift
More file actions
45 lines (40 loc) · 1.09 KB
/
CodeiumChatView.swift
File metadata and controls
45 lines (40 loc) · 1.09 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
import ComposableArchitecture
import Foundation
import SharedUIComponents
import SwiftUI
import WebKit
struct BrowserView: View {
@Perception.Bindable var store: StoreOf<CodeiumChatBrowser>
let webView: WKWebView
var body: some View {
WithPerceptionTracking {
VStack(spacing: 0) {
ZStack {
WebView(webView: webView)
}
}
.overlay {
if store.isLoading {
ProgressView()
}
}
.overlay {
if let error = store.error {
VStack {
Text(error)
Button("Load Current Workspace") {
store.send(.loadCurrentWorkspace)
}
}
}
}
}
}
}
struct WebView: NSViewRepresentable {
var webView: WKWebView
func makeNSView(context: Context) -> WKWebView {
return webView
}
func updateNSView(_ nsView: WKWebView, context: Context) {}
}