Skip to content

Commit a8186fa

Browse files
committed
styling improvements
1 parent ade1873 commit a8186fa

File tree

2 files changed

+15
-34
lines changed

2 files changed

+15
-34
lines changed

dashboard/components/database-sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ export function DatabaseSidebar({
355355
)
356356
? "bg-accent/50"
357357
: group.connectionMethod === "ws" &&
358-
"bg-callout text-callout-foreground",
358+
"bg-yellow-300/20 dark:bg-yellow-800/20",
359359
)}
360360
>
361361
<Checkbox

dashboard/components/latency-table.tsx

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from "@/components/ui/table";
1313
import { Button } from "@/components/ui/button";
1414
import { cn } from "@/lib/utils";
15-
import type { Database, Function, Stat } from "@/lib/schema";
15+
import type { Database, Function } from "@/lib/schema";
1616

1717
interface LatencyData {
1818
cold: Record<number, Record<number, number>>;
@@ -220,27 +220,8 @@ function LatencyTableClient({
220220
{ region: "South America East 1", code: "sa-east-1" }, // São Paulo (gru1)
221221
];
222222

223-
// Helper function to get the standardized region name
224-
const getStandardRegion = (label: string): string => {
225-
// First try to match by AWS region code
226-
for (const region of regionOrder) {
227-
if (label.toLowerCase().includes(region.code.toLowerCase())) {
228-
return region.region;
229-
}
230-
}
231-
// Then try to match by region name
232-
for (const region of regionOrder) {
233-
if (label.toLowerCase().includes(region.region.toLowerCase())) {
234-
return region.region;
235-
}
236-
}
237-
return label;
238-
};
239-
240223
// Sort region groups by region label
241224
const sortedRegionGroups = Object.values(regionGroups).sort((a, b) => {
242-
const regionA = getStandardRegion(a.regionCode); // Changed from regionLabel to regionCode
243-
const regionB = getStandardRegion(b.regionCode); // Changed from regionLabel to regionCode
244225
const indexA = regionOrder.findIndex(
245226
(r) => r.code === a.regionCode.toLowerCase(),
246227
);
@@ -296,15 +277,15 @@ function LatencyTableClient({
296277
if (latency === null)
297278
return <span className="text-muted-foreground">N/A</span>;
298279

299-
let colorClass = "text-status-green";
280+
let colorClass = "text-green-800 dark:text-green-400";
300281
if (queryType === "cold") {
301-
if (latency > 200) colorClass = "text-status-yellow";
302-
if (latency > 500) colorClass = "text-status-orange";
303-
if (latency > 1000) colorClass = "text-status-red";
282+
if (latency > 200) colorClass = "text-yellow-800 dark:text-yellow-400";
283+
if (latency > 500) colorClass = "text-orange-800 dark:text-orange-400";
284+
if (latency > 1000) colorClass = "text-red-800 dark:text-red-400";
304285
} else {
305-
if (latency > 100) colorClass = "text-status-yellow";
306-
if (latency > 250) colorClass = "text-status-orange";
307-
if (latency > 500) colorClass = "text-status-red";
286+
if (latency > 100) colorClass = "text-yellow-800 dark:text-yellow-400";
287+
if (latency > 250) colorClass = "text-orange-800 dark:text-orange-400";
288+
if (latency > 500) colorClass = "text-red-800 dark:text-red-400";
308289
}
309290

310291
return <span className={colorClass}>{latency.toFixed(2)}ms</span>;
@@ -340,7 +321,7 @@ function LatencyTableClient({
340321
<div className="space-y-3 min-w-full w-fit">
341322
<div className="flex flex-col gap-3">
342323
<div className="flex items-center space-x-1">
343-
<div className="h-3 w-3 rounded-sm bg-matched-region"></div>
324+
<div className="h-3 w-3 rounded-sm bg-green-100 dark:bg-green-900"></div>
344325
<span className="text-xs text-muted-foreground">
345326
Same region (recommended)
346327
</span>
@@ -463,7 +444,7 @@ function LatencyTableClient({
463444
{group.connectionMethod === "http" ? (
464445
<strong>http</strong>
465446
) : (
466-
<strong className="text-callout-foreground bg-callout px-1 rounded">
447+
<strong className="bg-yellow-300/20 dark:bg-yellow-800/20 px-1 rounded">
467448
websocket
468449
</strong>
469450
)}
@@ -542,9 +523,9 @@ function LatencyTableClient({
542523
className={cn(
543524
"text-center text-xs md:text-base",
544525
isSameRegionMatch
545-
? "bg-matched-region text-matched-region-foreground"
526+
? "bg-green-100 dark:bg-green-900"
546527
: group.connectionMethod === "ws" &&
547-
"bg-callout text-callout-foreground",
528+
"bg-yellow-300/20 dark:bg-yellow-800/20",
548529
groupIndex !== 0 && "border-l-2 border-l-muted",
549530
)}
550531
>
@@ -562,9 +543,9 @@ function LatencyTableClient({
562543
className={cn(
563544
"text-center text-xs md:text-base",
564545
isSameRegionMatch
565-
? "bg-matched-region text-matched-region-foreground"
546+
? "bg-green-100 dark:bg-green-900"
566547
: group.connectionMethod === "ws" &&
567-
"bg-callout text-callout-foreground",
548+
"bg-yellow-300/20 dark:bg-yellow-800/20",
568549
queryType === "both" && "border-l",
569550
groupIndex !== 0 &&
570551
queryType !== "both" &&

0 commit comments

Comments
 (0)