chore: remove URL_TRUNCATE_LENGTH from component

This commit is contained in:
Deepanshu committed 2025-06-18 11:09:23 +05:30
1 parent 75309fc53c
commit 6b3773ed76
2 files changed
+2 -5

No files matched your search

@@ -24,7 +24,6 @@ import { formatMonitorUrl } from "../../Utils/utils";
const Status = ({ monitor }) => { const Status = ({ monitor }) => {
const theme = useTheme(); const theme = useTheme();
const { statusColor, determineState } = useMonitorUtils(); const { statusColor, determineState } = useMonitorUtils();
const URL_TRUNCATION_LENGTH = 55;
return ( return (
<Stack> <Stack>
@@ -35,9 +34,7 @@ const Status = ({ monitor }) => {
gap={theme.spacing(4)} gap={theme.spacing(4)}
> >
<PulseDot color={statusColor[determineState(monitor)]} /> <PulseDot color={statusColor[determineState(monitor)]} />
<Typography variant="monitorUrl"> <Typography variant="monitorUrl">{formatMonitorUrl(monitor?.url)}</Typography>
{formatMonitorUrl(monitor?.url, URL_TRUNCATION_LENGTH)}
</Typography>
<Dot /> <Dot />
<Typography> <Typography>
Checking every {formatDurationRounded(monitor?.interval)}. Checking every {formatDurationRounded(monitor?.interval)}.
+1 -1
View File
@@ -6,7 +6,7 @@ export const safelyParseFloat = (value) => {
return parsedValue; return parsedValue;
}; };
export const formatMonitorUrl = (url, maxLength = 50) => { export const formatMonitorUrl = (url, maxLength = 55) => {
if (!url) return ""; if (!url) return "";
const strippedUrl = url.replace(/^https?:\/\//, ""); const strippedUrl = url.replace(/^https?:\/\//, "");
return strippedUrl.length > maxLength return strippedUrl.length > maxLength