// // RootView.swift // Zyquo Local // // Author: Simon-Pierre Boucher // Mail: contact@spboucher.ai // import SwiftUI /// Main window: sidebar + detail column (chat or model library). struct RootView: View { @Environment(AppModel.self) private var app private var theme = ThemeStore.shared init() {} var body: some View { NavigationSplitView { SidebarView() .navigationSplitViewColumnWidth( min: ZyquoTheme.sidebarWidth, ideal: ZyquoTheme.sidebarWidth, max: 320) } detail: { switch app.route { case .chat: ChatView() case .library: LibraryView() } } .background(ZyquoTheme.background) .preferredColorScheme(theme.mode.colorScheme) .alert( "Something went wrong", isPresented: Binding( get: { app.lastError != nil }, set: { if !$0 { app.lastError = nil } } ) ) { Button("OK") { app.lastError = nil } } message: { Text(app.lastError ?? "") } } }