31 lines
1.0 KiB
Swift
31 lines
1.0 KiB
Swift
import SstUI
|
|
import SwiftUI
|
|
|
|
struct MainWindow: View {
|
|
@EnvironmentObject private var model: AppModel
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
BrushedBackground().ignoresSafeArea()
|
|
HStack(spacing: 0) {
|
|
Sidebar()
|
|
VStack(spacing: Layout.panelGap) {
|
|
DeckView()
|
|
switch model.section {
|
|
case .transcripts: HistoryView(list: model.historyList)
|
|
case .dictionary: DictionaryView(list: model.dictionaryList)
|
|
case .note: NoteView(note: model.note)
|
|
}
|
|
}
|
|
.padding(Layout.panelPadding)
|
|
}
|
|
}
|
|
.confirmationDialog(Strings.clearHistoryConfirm, isPresented: $model.confirmingClearHistory) {
|
|
Button(Strings.erase, role: .destructive) { model.clearHistory() }
|
|
Button(Strings.cancel, role: .cancel) {}
|
|
} message: {
|
|
Text(Strings.clearHistoryDetail)
|
|
}
|
|
}
|
|
}
|