forked from intitni/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSuggestionSettingsView.swift
More file actions
53 lines (45 loc) · 1.36 KB
/
Copy pathSuggestionSettingsView.swift
File metadata and controls
53 lines (45 loc) · 1.36 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
import Client
import Preferences
import SharedUIComponents
import SwiftUI
import XPCShared
struct SuggestionSettingsView: View {
var tabContainer: ExternalTabContainer {
ExternalTabContainer.tabContainer(for: "SuggestionSettings")
}
enum Tab: Hashable {
case general
case other(String)
}
@State var tabSelection: Tab = .general
var body: some View {
VStack(spacing: 0) {
Picker("", selection: $tabSelection) {
Text("General").tag(Tab.general)
ForEach(tabContainer.tabs, id: \.id) { tab in
Text(tab.title).tag(Tab.other(tab.id))
}
}
.pickerStyle(.segmented)
.padding(8)
Divider()
.shadow(radius: 10)
ScrollView {
Group {
switch tabSelection {
case .general:
SuggestionSettingsGeneralSectionView()
case let .other(id):
tabContainer.tabView(for: id)
}
}.padding()
}
}
}
}
struct SuggestionSettingsView_Previews: PreviewProvider {
static var previews: some View {
SuggestionSettingsView()
.frame(width: 600, height: 500)
}
}