Skip to content

Commit d8b3ab7

Browse files
committed
refactor: rename Title to CanaryCheckName for clarity
1 parent 6569c82 commit d8b3ab7

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

src/components/Canary/CanaryCards.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import React from "react";
2-
import { GetName } from "./data";
3-
import { Title, StatusList } from "./renderers";
41
import { HealthCheck } from "../../api/types/health";
2+
import { GetName } from "./data";
3+
import { CanaryCheckName, StatusList } from "./renderers";
54

65
type CanaryCardProps = {
76
checks: HealthCheck[];
@@ -23,7 +22,10 @@ export function CanaryCards({ checks, onClick }: CanaryCardProps) {
2322
>
2423
<div className="flex-1 py-2 text-sm">
2524
<span className="truncate font-medium text-gray-900 hover:text-gray-600">
26-
<Title title={GetName(check)} icon={check.icon || check.type} />
25+
<CanaryCheckName
26+
title={GetName(check)}
27+
icon={check.icon || check.type}
28+
/>
2729
</span>
2830
<div className="float-right mr-2">
2931
<StatusList check={check} />

src/components/Canary/Columns/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ import dayjs from "dayjs";
66
import { Status } from "../../Status";
77
import { GetName } from "../data";
88
import style from "../index.module.css";
9-
import { Duration, Percentage, StatusList, Title, empty } from "../renderers";
9+
import {
10+
CanaryCheckName,
11+
Duration,
12+
empty,
13+
Percentage,
14+
StatusList
15+
} from "../renderers";
1016
import { removeNamespacePrefix } from "../utils";
1117
import {
1218
getHealthPercentageScore,
@@ -131,7 +137,7 @@ export function TitleCell({
131137
// paddingLeft: `${row.depth * 1.1}rem`
132138
// }}
133139
>
134-
<Title
140+
<CanaryCheckName
135141
title={title}
136142
icon={rowValues.icon || rowValues.type}
137143
isDeleted={!!row.original.deleted_at}

src/components/Canary/renderers.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,17 @@ export function Percentage({ val, upper, lower }: PercentageProps) {
120120
);
121121
}
122122

123-
type TitleProps = {
123+
type CanaryCheckNameProps = {
124124
icon?: string;
125125
title: string;
126126
isDeleted?: boolean;
127127
};
128128

129-
export function Title({ icon, title, isDeleted }: TitleProps) {
129+
export function CanaryCheckName({
130+
icon,
131+
title,
132+
isDeleted
133+
}: CanaryCheckNameProps) {
130134
return (
131135
<>
132136
{icon && <Icon name={icon} className="h-6 w-auto" />}

0 commit comments

Comments
 (0)