Skip to content

Commit d388f2e

Browse files
committed
consistent and distinct colors for status
1 parent 7bd8626 commit d388f2e

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

src/components/repositories/Repository.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
type RepositoryApiResponse,
1010
type RepoStatus,
1111
} from "@/types/Repository";
12-
import { apiRequest, showErrorToast } from "@/lib/utils";
12+
import { apiRequest, showErrorToast, getStatusColor } from "@/lib/utils";
1313
import {
1414
Select,
1515
SelectContent,
@@ -707,12 +707,7 @@ export default function Repository() {
707707
<SelectItem key={status} value={status}>
708708
<span className="flex items-center gap-2">
709709
{status !== "all" && (
710-
<span className={`h-2 w-2 rounded-full ${
711-
status === "synced" ? "bg-green-500" :
712-
status === "failed" ? "bg-red-500" :
713-
status === "syncing" ? "bg-blue-500" :
714-
"bg-yellow-500"
715-
}`} />
710+
<span className={`h-2 w-2 rounded-full ${getStatusColor(status)}`} />
716711
)}
717712
{status === "all"
718713
? "All statuses"
@@ -814,12 +809,7 @@ export default function Repository() {
814809
<SelectItem key={status} value={status}>
815810
<span className="flex items-center gap-2">
816811
{status !== "all" && (
817-
<span className={`h-2 w-2 rounded-full ${
818-
status === "synced" ? "bg-green-500" :
819-
status === "failed" ? "bg-red-500" :
820-
status === "syncing" ? "bg-blue-500" :
821-
"bg-yellow-500"
822-
}`} />
812+
<span className={`h-2 w-2 rounded-full ${getStatusColor(status)}`} />
823813
)}
824814
{status === "all"
825815
? "All statuses"

src/lib/utils.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,17 @@ export async function apiRequest<T>(
197197
export const getStatusColor = (status: string): string => {
198198
switch (status) {
199199
case "imported":
200-
return "bg-blue-500"; // Info/primary-like
200+
return "bg-yellow-500"; // Ready to mirror
201201
case "mirroring":
202-
return "bg-yellow-400"; // In progress
202+
return "bg-amber-500"; // In progress
203203
case "mirrored":
204-
return "bg-emerald-500"; // Success
204+
return "bg-green-500"; // Successfully mirrored
205205
case "failed":
206-
return "bg-rose-500"; // Error
206+
return "bg-red-500"; // Error
207207
case "syncing":
208-
return "bg-indigo-500"; // Sync in progress
208+
return "bg-blue-500"; // Sync in progress
209209
case "synced":
210-
return "bg-teal-500"; // Sync complete
210+
return "bg-emerald-500"; // Successfully synced
211211
case "skipped":
212212
return "bg-gray-500"; // Skipped
213213
case "deleting":

0 commit comments

Comments
 (0)