Skip to content

Commit 054447a

Browse files
committed
update
1 parent 16eca8f commit 054447a

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

lib/render.tsx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export interface TestTimelineProps {
2222
color: "red" | "yellow";
2323
}
2424

25-
export function TestTimeline({ dateRange, dailyCounts, color }: TestTimelineProps) {
25+
export function TestTimeline(
26+
{ dateRange, dailyCounts, color }: TestTimelineProps,
27+
) {
2628
if (dateRange.length === 0) {
2729
return null;
2830
}
@@ -45,15 +47,18 @@ export function TestTimeline({ dateRange, dailyCounts, color }: TestTimelineProp
4547
const lastOccurrence = sortedDates[sortedDates.length - 1];
4648
const lastOccurrenceFormatted = lastOccurrence
4749
? new Date(lastOccurrence + "T00:00:00").toLocaleDateString("en-US", {
48-
month: "short",
49-
day: "numeric",
50-
})
50+
month: "short",
51+
day: "numeric",
52+
})
5153
: null;
5254

5355
return (
5456
<div class="mt-2">
5557
<div class="flex items-center gap-2">
56-
<div class="flex items-end gap-px flex-1" style={{ minWidth: 0, height: "16px" }}>
58+
<div
59+
class="flex items-end gap-px flex-1"
60+
style={{ minWidth: 0, height: "16px" }}
61+
>
5762
{dateRange.map((date) => {
5863
const count = countsMap.get(date) || 0;
5964
const height = count > 0 ? Math.max(4, (count / maxCount) * 16) : 2;
@@ -64,7 +69,14 @@ export function TestTimeline({ dateRange, dailyCounts, color }: TestTimelineProp
6469
key={date}
6570
class="flex-1"
6671
style={{ minWidth: "2px", maxWidth: "8px" }}
67-
title={`${new Date(date + "T00:00:00").toLocaleDateString("en-US", { month: "short", day: "numeric" })}: ${count} ${color === "red" ? "failure" : "flake"}${count !== 1 ? "s" : ""}`}
72+
title={`${
73+
new Date(date + "T00:00:00").toLocaleDateString("en-US", {
74+
month: "short",
75+
day: "numeric",
76+
})
77+
}: ${count} ${color === "red" ? "failure" : "flake"}${
78+
count !== 1 ? "s" : ""
79+
}`}
6880
>
6981
<div
7082
style={{

0 commit comments

Comments
 (0)