Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions PCL.Mac/App/AppRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,5 @@ class AppRouter: ObservableObject {
}
}

private init() {
}
private init() {}
}
23 changes: 23 additions & 0 deletions PCL.Mac/App/MessageBoxManager.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// MessageBoxManager.swift
// PCL.Mac
//
// Created by 温迪 on 2026/1/20.
//

import Foundation

class MessageBoxManager: ObservableObject {
public static let shared: MessageBoxManager = .init()
@Published public private(set) var currentMessageBox: MessageBox?

public func showText(title: String, body: String, level: MessageBox.Level = .info) {
currentMessageBox = .init(title: title, body: .text(text: body), level: level)
}

public func close() {
currentMessageBox = nil
}

private init() {}
}
22 changes: 22 additions & 0 deletions PCL.Mac/Models/MessageBox.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// MessageBox.swift
// PCL.Mac
//
// Created by 温迪 on 2026/1/20.
//

import Foundation

struct MessageBox {
public let title: String
public let body: Body
public let level: Level

public enum Body {
case text(text: String)
}

public enum Level {
case info, error
}
}