This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,24 @@
// Metro module 15033 (f15034).
import { useState, useEffect } from "react";
import { getRelativeTimestamp } from "./NotificationCenterUtils";
import Durations from "../../utils/Durations";
export function useRelativeTimestamp({ timestamp, abbreviated = true }) {
let setState;
let c21543_1 = abbreviated;
setState = void 0;
let state;
[state, setState] = useState(() => getRelativeTimestamp(timestamp, c21543_1));
useEffect(() => {
setState(getRelativeTimestamp(timestamp, c21543_1));
const r17 = Date.now() - timestamp;
if (r17 > Durations.Millis.DAY) {
return void 0;
}
const r30 = r17 >= Durations.Millis.HOUR ? Durations.Millis.HOUR : Durations.Millis.MINUTE;
let c27888_0 = setInterval(() => {
setState(getRelativeTimestamp(timestamp, c21543_1));
}, r30, r30 - r17 % r30);
return () => clearInterval(c27888_0);
}, [timestamp, abbreviated]);
return state;
}