-
-
Save laevandus/9bcfe1cf35cd6e93d10030fc2bbb5c39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct FailureView: View { | |
let error: Error | |
let retryTask: () async -> Void | |
var body: some View { | |
ContentUnavailableView(label: { | |
Label("Failed to load", systemImage: "exclamationmark.circle.fill") | |
}, description: { | |
Text(error.localizedDescription) | |
}, actions: { | |
Button(action: { | |
Task { await retryTask() } | |
}, label: { | |
Text("Retry") | |
}) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment