# Conflicts: # Sources/Panels/BrowserPanel.swift # Sources/cmuxApp.swift # cmuxTests/CmuxWebViewKeyEquivalentTests.swift # vendor/bonsplit
46 lines
1.5 KiB
Swift
46 lines
1.5 KiB
Swift
import SwiftUI
|
|
import Foundation
|
|
|
|
/// View that renders the appropriate panel view based on panel type
|
|
struct PanelContentView: View {
|
|
let panel: any Panel
|
|
let isFocused: Bool
|
|
let isSelectedInPane: Bool
|
|
let isVisibleInUI: Bool
|
|
let portalPriority: Int
|
|
let isSplit: Bool
|
|
let appearance: PanelAppearance
|
|
let hasUnreadNotification: Bool
|
|
let onFocus: () -> Void
|
|
let onRequestPanelFocus: () -> Void
|
|
let onTriggerFlash: () -> Void
|
|
|
|
var body: some View {
|
|
switch panel.panelType {
|
|
case .terminal:
|
|
if let terminalPanel = panel as? TerminalPanel {
|
|
TerminalPanelView(
|
|
panel: terminalPanel,
|
|
isFocused: isFocused,
|
|
isVisibleInUI: isVisibleInUI,
|
|
portalPriority: portalPriority,
|
|
isSplit: isSplit,
|
|
appearance: appearance,
|
|
hasUnreadNotification: hasUnreadNotification,
|
|
onFocus: onFocus,
|
|
onTriggerFlash: onTriggerFlash
|
|
)
|
|
}
|
|
case .browser:
|
|
if let browserPanel = panel as? BrowserPanel {
|
|
BrowserPanelView(
|
|
panel: browserPanel,
|
|
isFocused: isFocused,
|
|
isVisibleInUI: isVisibleInUI,
|
|
portalPriority: portalPriority,
|
|
onRequestPanelFocus: onRequestPanelFocus
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|