"use client";
import * as React from "react";
//#region src/components/molecules/data/Calendar/_shared/use-current-time.ts
/**
* Tracks current time and computes vertical position within a time grid.
* Updates every 60 seconds. Shared between DayView and WeekView.
*/
function useCurrentTime(startHour, endHour, isInView) {
	const [now, setNow] = React.useState(() => /* @__PURE__ */ new Date());
	React.useEffect(() => {
		if (!isInView) return;
		const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
		return () => clearInterval(interval);
	}, [isInView]);
	const currentHour = now.getHours() + now.getMinutes() / 60;
	return {
		now,
		top: (currentHour - startHour) * 96,
		visible: isInView && currentHour >= startHour && currentHour < endHour
	};
}
//#endregion
export { useCurrentTime };

//# sourceMappingURL=index67.js.map