Files
ios-client/IosClientKit/Sources/CoreUI/ErrorView.swift
2026-09-14 21:10:44 +08:00

23 lines
557 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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)
}
}
}