diff options
Diffstat (limited to 'Rune/Views/Shared/FeedbackViews.swift')
| -rw-r--r-- | Rune/Views/Shared/FeedbackViews.swift | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Rune/Views/Shared/FeedbackViews.swift b/Rune/Views/Shared/FeedbackViews.swift new file mode 100644 index 0000000..9267ce2 --- /dev/null +++ b/Rune/Views/Shared/FeedbackViews.swift @@ -0,0 +1,38 @@ +import SwiftUI + +struct InlineErrorView: View { + let message: String + let retryTitle: String + let retryAction: () -> Void + + var body: some View { + VStack(alignment: .leading, spacing: 8) { + Text(message) + .font(.subheadline) + .foregroundStyle(.red) + + Button(retryTitle, action: retryAction) + .font(.subheadline.weight(.semibold)) + } + .frame(maxWidth: .infinity, alignment: .leading) + .padding() + .background(Color.red.opacity(0.08), in: RoundedRectangle(cornerRadius: 12, style: .continuous)) + } +} + +struct FeedbackBanner: View { + let message: String + let tint: Color + + var body: some View { + Text(message) + .font(.subheadline.weight(.semibold)) + .foregroundStyle(tint) + .frame(maxWidth: .infinity, alignment: .leading) + .padding(.horizontal, 14) + .padding(.vertical, 10) + .background(tint.opacity(0.12), in: RoundedRectangle(cornerRadius: 12, style: .continuous)) + .padding(.horizontal) + .padding(.top, 8) + } +} |
