ts errors

This commit is contained in:
Alex Holliday committed 2026-01-06 20:55:27 +00:00
1 parent 51081a6a0e
commit ba7cc3bb0c
13 files changed
+34 -58

No files matched your search

@@ -1,12 +1,12 @@
import Box from "@mui/material/Box";
import { useTheme } from "@mui/material/styles";
import type { ICheck } from "@/types/check";
import type { Check } from "@/types/check";
import { getResponseColor } from "@/utils/DataUtils";
import { HeatmapResponseTimeTooltip } from "./HeatmapResponseTimeTooltip";
import type { SxProps } from "@mui/material/styles";
import type { ResponsiveStyleValue } from "@mui/system";
interface HeatmapResponseTimeProps {
checks: ICheck[];
checks: Check[];
gap?: ResponsiveStyleValue<number | string>;
availabilityCellSx?: SxProps;
responseCellSx?: SxProps;
@@ -27,7 +27,7 @@ export const HeatmapResponseTime = ({
const latestChecks = checks.slice(-25).reverse();
let data: Array<ICheck | { status: "placeholder" }>;
let data: Array<Check | { status: "placeholder" }>;
if (latestChecks.length !== 25) {
const placeholders = Array(25 - latestChecks.length).fill({
status: "placeholder" as const,
@@ -57,7 +57,7 @@ export const HeatmapResponseTime = ({
const respBg =
check.status === "placeholder"
? theme.palette.action.hover
: getResponseColor(check.responseTime, {
: getResponseColor(check.responseTime || 0, {
start: theme.palette.success.main,
mid: theme.palette.warning.main,
end: theme.palette.error.main,
@@ -1,12 +1,12 @@
import Box from "@mui/material/Box";
import { useTheme } from "@mui/material/styles";
import type { ResponsiveStyleValue } from "@mui/system";
import type { ICheck } from "@/types/check";
import type { Check } from "@/types/check";
import { normalizeResponseTimes } from "@/utils/DataUtils";
import { HeatmapResponseTimeTooltip } from "./HeatmapResponseTimeTooltip";
interface HistogramResponseTimeProps {
checks: ICheck[];
checks: Check[];
height?: ResponsiveStyleValue<number | string>;
gap?: ResponsiveStyleValue<number | string>;
}
@@ -9,16 +9,16 @@ import {
import { HistogramPageSpeedTooltip } from "@/components/monitors/HistogramPageSpeedTooltip";
import { useTheme } from "@mui/material/styles";
import type { ICheck } from "@/types/check";
import type { Check } from "@/types/check";
import type { MonitorStatus } from "@/types/monitor";
import { getStatusColor } from "@/utils/MonitorUtils";
const processData = (checks: ICheck[]) => {
const processData = (checks: Check[]) => {
if (checks.length === 0) return [];
const formattedData: { score: number; date: string }[] = [];
const calculateScore = (entry: ICheck) => {
const calculateScore = (entry: Check) => {
const accessibility = entry?.lighthouse?.accessibility || 0;
const bestPractices = entry?.lighthouse?.bestPractices || 0;
const performance = entry?.lighthouse?.performance || 0;
@@ -41,7 +41,7 @@ export const HistogramPageSpeed = ({
checks,
status,
}: {
checks: ICheck[];
checks: Check[];
status: MonitorStatus;
}) => {
const theme = useTheme();
@@ -1,12 +1,12 @@
import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box";
import { useTheme } from "@mui/material/styles";
import type { ICheck } from "@/types/check";
import type { Check } from "@/types/check";
import { normalizeResponseTimes } from "@/utils/DataUtils";
import { HeatmapResponseTimeTooltip } from "../common/HeatmapResponseTimeTooltip";
const BAR_HEIGHT = "50px";
export const HistogramStatusPage = ({ checks }: { checks: ICheck[] }) => {
export const HistogramStatusPage = ({ checks }: { checks: Check[] }) => {
const theme = useTheme();
const normalChecks = normalizeResponseTimes(checks, "responseTime");
let data = Array<any>();