Merge branch 'develop' into incidents-feat-modal

This commit is contained in:
karenvicent committed 2026-01-20 20:46:02 -05:00
commit eb8c9bea76
311 files changed
+9539 -6966

No files matched your search

@@ -0,0 +1,25 @@
import { getHumanReadableDuration } from "@/Utils/timeUtils.js";
const useGetIncidentsDuration = (incident, isActive) => {
if (!incident?.startTime) {
return "-";
}
const startTime = new Date(incident?.startTime);
const endTime = isActive
? new Date()
: incident?.endTime
? new Date(incident.endTime)
: null;
if (!endTime) {
return "-";
}
const durationMs = endTime.getTime() - startTime.getTime();
if (durationMs < 0) {
return "-";
}
return getHumanReadableDuration(durationMs);
};
export default useGetIncidentsDuration;