|
|
@@ -19,7 +19,13 @@ struct SpellCheckerView: View {
|
|
|
let dynamicBottomPadding = min(max(proxy.size.height * 0.04, 20), 40)
|
|
|
|
|
|
Group {
|
|
|
- if viewModel.hasResults {
|
|
|
+ if viewModel.isChecking {
|
|
|
+ loadingLayout(
|
|
|
+ horizontalPadding: dynamicHorizontalPadding,
|
|
|
+ topPadding: AppTheme.brandLabelTopInset,
|
|
|
+ bottomPadding: dynamicBottomPadding
|
|
|
+ )
|
|
|
+ } else if viewModel.hasResults {
|
|
|
VStack(alignment: .leading, spacing: 0) {
|
|
|
header
|
|
|
.padding(.bottom, 20)
|
|
|
@@ -73,6 +79,30 @@ struct SpellCheckerView: View {
|
|
|
onRestoreHandled()
|
|
|
}
|
|
|
|
|
|
+ private func loadingLayout(
|
|
|
+ horizontalPadding: CGFloat,
|
|
|
+ topPadding: CGFloat,
|
|
|
+ bottomPadding: CGFloat
|
|
|
+ ) -> some View {
|
|
|
+ VStack(spacing: 14) {
|
|
|
+ ProgressView()
|
|
|
+ .controlSize(.regular)
|
|
|
+
|
|
|
+ Text("Loading...")
|
|
|
+ .font(.system(size: 16, weight: .semibold))
|
|
|
+ .foregroundStyle(AppTheme.textPrimary)
|
|
|
+
|
|
|
+ Text("Checking spelling and generating corrections")
|
|
|
+ .font(.system(size: 14))
|
|
|
+ .foregroundStyle(AppTheme.textSecondary)
|
|
|
+ }
|
|
|
+ .frame(maxWidth: 1200, maxHeight: .infinity, alignment: .center)
|
|
|
+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
|
|
|
+ .padding(.horizontal, horizontalPadding)
|
|
|
+ .padding(.top, topPadding)
|
|
|
+ .padding(.bottom, bottomPadding)
|
|
|
+ }
|
|
|
+
|
|
|
private var header: some View {
|
|
|
VStack(alignment: .leading, spacing: 16) {
|
|
|
if viewModel.hasResults {
|