mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Automated rebrand of all openclaw references to hanzo bot: - Package: openclaw -> @hanzo/bot - Binary: openclaw -> hanzo-bot - Config: ~/.openclaw -> ~/.hanzo/bot - Docker: ghcr.io/hanzoai/bot - Env vars: OPENCLAW_* -> BOT_* - Bundle IDs: ai.hanzo.bot.* - Product name: Hanzo Bot
48 lines
1.6 KiB
Swift
48 lines
1.6 KiB
Swift
import Hanzo BotChatUI
|
|
import Hanzo BotKit
|
|
import SwiftUI
|
|
|
|
struct ChatSheet: View {
|
|
@Environment(\.dismiss) private var dismiss
|
|
@State private var viewModel: Hanzo BotChatViewModel
|
|
private let userAccent: Color?
|
|
private let agentName: String?
|
|
|
|
init(gateway: GatewayNodeSession, sessionKey: String, agentName: String? = nil, userAccent: Color? = nil) {
|
|
let transport = IOSGatewayChatTransport(gateway: gateway)
|
|
self._viewModel = State(
|
|
initialValue: Hanzo BotChatViewModel(
|
|
sessionKey: sessionKey,
|
|
transport: transport))
|
|
self.userAccent = userAccent
|
|
self.agentName = agentName
|
|
}
|
|
|
|
var body: some View {
|
|
NavigationStack {
|
|
Hanzo BotChatView(
|
|
viewModel: self.viewModel,
|
|
showsSessionSwitcher: true,
|
|
userAccent: self.userAccent)
|
|
.navigationTitle(self.chatTitle)
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
.toolbar {
|
|
ToolbarItem(placement: .topBarTrailing) {
|
|
Button {
|
|
self.dismiss()
|
|
} label: {
|
|
Image(systemName: "xmark")
|
|
}
|
|
.accessibilityLabel("Close")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private var chatTitle: String {
|
|
let trimmed = (self.agentName ?? "").trimmingCharacters(in: .whitespacesAndNewlines)
|
|
if trimmed.isEmpty { return "Chat" }
|
|
return "Chat (\(trimmed))"
|
|
}
|
|
}
|