Skip to content

Instantly share code, notes, and snippets.

@laevandus
Last active November 8, 2023 10:18
Show Gist options
  • Save laevandus/9bcfe1cf35cd6e93d10030fc2bbb5c39 to your computer and use it in GitHub Desktop.
Save laevandus/9bcfe1cf35cd6e93d10030fc2bbb5c39 to your computer and use it in GitHub Desktop.
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