forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChatTabItem.swift
More file actions
49 lines (41 loc) · 1.14 KB
/
ChatTabItem.swift
File metadata and controls
49 lines (41 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
42
43
44
45
46
47
48
import ComposableArchitecture
import Foundation
public struct AnyChatTabBuilder: Equatable {
public static func == (lhs: AnyChatTabBuilder, rhs: AnyChatTabBuilder) -> Bool {
true
}
public let chatTabBuilder: any ChatTabBuilder
public init(_ chatTabBuilder: any ChatTabBuilder) {
self.chatTabBuilder = chatTabBuilder
}
}
@Reducer
public struct ChatTabItem {
public typealias State = ChatTabInfo
public enum Action: Equatable {
case updateTitle(String)
case openNewTab(AnyChatTabBuilder)
case tabContentUpdated
case close
case focus
}
public init() {}
public var body: some ReducerOf<Self> {
Reduce { state, action in
switch action {
case let .updateTitle(title):
state.title = title
return .none
case .openNewTab:
return .none
case .tabContentUpdated:
return .none
case .close:
return .none
case .focus:
state.focusTrigger += 1
return .none
}
}
}
}