const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
let react = require("react");
let dayjs = require("dayjs");
dayjs = require_runtime.__toESM(dayjs);
//#region src/components/pisellTimeNavigator/hooks/useRealtime.ts
/**
* Realtime 模式：每秒将当前系统时间通过 onTick 回传
*/
function useRealtime(enabled, onTick) {
	(0, react.useEffect)(() => {
		if (!enabled) return;
		const id = setInterval(() => {
			onTick((0, dayjs.default)());
		}, 1e3);
		return () => clearInterval(id);
	}, [enabled, onTick]);
}
//#endregion
exports.useRealtime = useRealtime;
