Files
platform/ios/Platform 1.44.16 AM/Platform/Shared/Components/LoadingView.swift
Yusuf Suleman fdb8aeba8a
All checks were successful
Security Checks / dependency-audit (push) Successful in 12s
Security Checks / secret-scanning (push) Successful in 3s
Security Checks / dockerfile-lint (push) Successful in 3s
restore: original UI views from first build, keep fixed models/API
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 01:54:46 -05:00

73 lines
1.8 KiB
Swift

import SwiftUI
struct LoadingView: View {
var message: String = "Loading..."
var body: some View {
VStack(spacing: 16) {
ProgressView()
.controlSize(.large)
.tint(Color.accentWarm)
Text(message)
.font(.subheadline)
.foregroundStyle(Color.text3)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.canvas)
}
}
struct ErrorBanner: View {
let message: String
var onRetry: (() -> Void)?
var body: some View {
HStack(spacing: 12) {
Image(systemName: "exclamationmark.triangle.fill")
.foregroundStyle(Color.error)
Text(message)
.font(.subheadline)
.foregroundStyle(Color.text2)
Spacer()
if let onRetry {
Button("Retry") {
onRetry()
}
.font(.subheadline.weight(.semibold))
.foregroundStyle(Color.accentWarm)
}
}
.padding(12)
.background(Color.error.opacity(0.06))
.clipShape(RoundedRectangle(cornerRadius: 12))
}
}
struct EmptyStateView: View {
let icon: String
let title: String
let subtitle: String
var body: some View {
VStack(spacing: 12) {
Image(systemName: icon)
.font(.system(size: 40))
.foregroundStyle(Color.text4)
Text(title)
.font(.headline)
.foregroundStyle(Color.text2)
Text(subtitle)
.font(.subheadline)
.foregroundStyle(Color.text3)
.multilineTextAlignment(.center)
}
.padding(40)
.frame(maxWidth: .infinity)
}
}