strings
This commit is contained in:
1 parent
b7a6d50c73
commit
f9b677b1ad
2 files changed
+7
-10
No files matched your search
@@ -57,19 +57,15 @@ export const SummaryCardActiveIncidents = ({ incidents }: SummaryCardIncidentsPr
|
|||||||
|
|
||||||
if (!incidents) return null;
|
if (!incidents) return null;
|
||||||
|
|
||||||
const hasActive = incidents.some((incident) => incident.status === true);
|
const activeCount = incidents.filter((incident) => incident.status === true).length;
|
||||||
const activeCount = hasActive
|
const hasActive = activeCount > 0;
|
||||||
? incidents.filter((incident) => incident.status === true).length
|
|
||||||
: 0;
|
|
||||||
const color = hasActive ? theme.palette.error.main : theme.palette.success.main;
|
const color = hasActive ? theme.palette.error.main : theme.palette.success.main;
|
||||||
const icon = hasActive ? (
|
const icon = hasActive ? (
|
||||||
<TriangleAlert color={color} />
|
<TriangleAlert color={color} />
|
||||||
) : (
|
) : (
|
||||||
<CircleCheck color={color} />
|
<CircleCheck color={color} />
|
||||||
);
|
);
|
||||||
const msg = hasActive
|
const msg = t("pages.incidents.summaryCard.activeIncidents.active", { count: activeCount });
|
||||||
? `${activeCount} ${t("pages.incidents.summaryCard.activeIncidents.active")}`
|
|
||||||
: t("pages.incidents.summaryCard.activeIncidents.noActive");
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SummaryCard title={t("pages.incidents.summaryCard.activeIncidents.title")}>
|
<SummaryCard title={t("pages.incidents.summaryCard.activeIncidents.title")}>
|
||||||
@@ -109,7 +105,7 @@ export const SummaryCardLatestIncidents = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
interface SummaryCardStatsProps {
|
interface SummaryCardStatsProps {
|
||||||
summary?: IncidentSummary;
|
summary?: IncidentSummary | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SummaryCardStats = ({ summary }: SummaryCardStatsProps) => {
|
export const SummaryCardStats = ({ summary }: SummaryCardStatsProps) => {
|
||||||
|
|||||||
@@ -355,8 +355,9 @@
|
|||||||
"summaryCard": {
|
"summaryCard": {
|
||||||
"activeIncidents": {
|
"activeIncidents": {
|
||||||
"title": "Active Incidents",
|
"title": "Active Incidents",
|
||||||
"noActive": "No active incidents",
|
"active_zero": "No active incidents",
|
||||||
"active": "Active incident(s)"
|
"active_one": "{{count}} Active incident",
|
||||||
|
"active_other": "{{count}} Active incidents"
|
||||||
},
|
},
|
||||||
"latestIncidents": { "title": "Latest Incidents" },
|
"latestIncidents": { "title": "Latest Incidents" },
|
||||||
"incidentStats": { "title": "Incident Statistics" }
|
"incidentStats": { "title": "Incident Statistics" }
|
||||||
|
|||||||
Reference in new issue
Block a user