// 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; }