Refactor Dashboard

This commit is contained in:
世界
2025-11-26 22:25:51 +08:00
parent 2e2fc223bf
commit f6d14dbb8a
27 changed files with 773 additions and 742 deletions
@@ -0,0 +1,32 @@
import Library
import SwiftUI
@MainActor
public struct InstallProfileButton: View {
@State private var alert: Alert?
private let callback: () async -> Void
public init(_ callback: @escaping (() async -> Void)) {
self.callback = callback
}
public var body: some View {
FormButton {
Task {
await installProfile()
}
} label: {
Label("Install Network Extension", systemImage: "lock.doc.fill")
}
.alertBinding($alert)
}
private func installProfile() async {
do {
try await ExtensionProfile.install()
await callback()
} catch {
alert = Alert(error)
}
}
}