diff --git a/supacode/Features/Repositories/Views/EmptyStateView.swift b/supacode/Features/Repositories/Views/EmptyStateView.swift index fc6800e8..8d800bbf 100644 --- a/supacode/Features/Repositories/Views/EmptyStateView.swift +++ b/supacode/Features/Repositories/Views/EmptyStateView.swift @@ -7,20 +7,14 @@ struct EmptyStateView: View { var body: some View { let shortcutDisplay = AppShortcuts.display(for: AppShortcuts.CommandID.openRepository, in: resolvedKeybindings) - VStack(spacing: 16) { - Image(systemName: "tray") - .font(.title2) - .accessibilityHidden(true) - .padding(.bottom, 4) - Text("Open a repository or folder") - .font(.headline) + ContentUnavailableView { + Label("Open a repository or folder", systemImage: "tray") + } description: { Text(promptText(shortcutDisplay: shortcutDisplay)) - .font(.subheadline) - .foregroundStyle(.secondary) + } actions: { Button("Add Repository...") { store.send(.setOpenPanelPresented(true)) } - .padding(.top, 4) .modifier( KeyboardShortcutModifier( shortcut: resolvedKeybindings.keyboardShortcut(for: AppShortcuts.CommandID.openRepository) @@ -33,10 +27,8 @@ struct EmptyStateView: View { in: resolvedKeybindings )) } - .padding(24) .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color(nsColor: .windowBackgroundColor)) - .multilineTextAlignment(.center) } private func promptText(shortcutDisplay: String?) -> String { diff --git a/supacode/Features/Shelf/Views/ShelfView.swift b/supacode/Features/Shelf/Views/ShelfView.swift index 1aa07110..00d15fe4 100644 --- a/supacode/Features/Shelf/Views/ShelfView.swift +++ b/supacode/Features/Shelf/Views/ShelfView.swift @@ -166,17 +166,11 @@ struct ShelfView: View { @ViewBuilder private func emptyOpenArea() -> some View { - VStack(spacing: 10) { - Image(systemName: "books.vertical") - .font(.system(size: 40)) - .foregroundStyle(.secondary) - .accessibilityHidden(true) - Text("No worktree selected") - .font(.headline) - Text("Click a worktree to open it.") - .font(.callout) - .foregroundStyle(.secondary) - } + ContentUnavailableView( + "No worktree selected", + systemImage: "books.vertical", + description: Text("Click a worktree to open it.") + ) .frame(maxWidth: .infinity, maxHeight: .infinity) }