chore: core 多模块骨架
This commit is contained in:
22
IosClientKit/Sources/CoreUI/ErrorView.swift
Normal file
22
IosClientKit/Sources/CoreUI/ErrorView.swift
Normal file
@@ -0,0 +1,22 @@
|
||||
import SwiftUI
|
||||
|
||||
/// 错误占位视图(带重试)。
|
||||
public struct ErrorView: View {
|
||||
private let message: String
|
||||
private let retry: () -> Void
|
||||
|
||||
public init(message: String, retry: @escaping () -> Void) {
|
||||
self.message = message
|
||||
self.retry = retry
|
||||
}
|
||||
|
||||
public var body: some View {
|
||||
ContentUnavailableView {
|
||||
Label("出错了", systemImage: "exclamationmark.triangle")
|
||||
} description: {
|
||||
Text(message)
|
||||
} actions: {
|
||||
Button("重试", action: retry)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user