diff options
| author | Christian Cleberg <[email protected]> | 2026-04-12 18:53:13 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-12 18:53:13 -0500 |
| commit | b526cddd8ec421eba00feecbdffae3978cb61b34 (patch) | |
| tree | f8426032d07a92d034975e90decd1ec0f85bd452 /Hutch/Views/Builds | |
| parent | 92fb89cd35588ee36190c95b1af1e9595b397fae (diff) | |
| download | hutch-2.16.0.tar.gz hutch-2.16.0.tar.bz2 hutch-2.16.0.zip | |
feat: improve Home structure and navigationv2.16.0
implements: https://todo.sr.ht/~ccleberg/hutch/14
implements: https://todo.sr.ht/~ccleberg/hutch/15
implements: https://todo.sr.ht/~ccleberg/hutch/16
Diffstat (limited to 'Hutch/Views/Builds')
| -rw-r--r-- | Hutch/Views/Builds/BuildRowView.swift | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Hutch/Views/Builds/BuildRowView.swift b/Hutch/Views/Builds/BuildRowView.swift index e2afd27..9602e5c 100644 --- a/Hutch/Views/Builds/BuildRowView.swift +++ b/Hutch/Views/Builds/BuildRowView.swift @@ -36,6 +36,44 @@ struct BuildRowView: View { } } +struct JobStatusBadge: View { + let status: JobStatus + + var body: some View { + HStack(spacing: 4) { + JobStatusIcon(status: status) + .frame(width: 12, height: 12) + Text(status.displayTitle) + .font(.caption2.weight(.medium)) + } + .foregroundStyle(.secondary) + .padding(.horizontal, 8) + .padding(.vertical, 4) + .background(Color(.secondarySystemFill), in: Capsule()) + } +} + +extension JobStatus { + var displayTitle: String { + switch self { + case .pending: + "Pending" + case .queued: + "Queued" + case .running: + "Running" + case .success: + "Succeeded" + case .failed: + "Failed" + case .cancelled: + "Cancelled" + case .timeout: + "Timed Out" + } + } +} + // MARK: - Job Status Icon struct JobStatusIcon: View { |
