"use client";
import { CurrentTimeMarker } from "./index56.js";
import { TimeGrid } from "./index62.js";
import { DayColumn } from "./index63.js";
import { EventDetailPanel } from "./index64.js";
import { MiniMonthCalendar } from "./index66.js";
import { useCurrentTime } from "./index67.js";
import { useCalendarContext } from "./index76.js";
import { jsx, jsxs } from "react/jsx-runtime";
import { isToday } from "date-fns";
//#region src/components/molecules/data/Calendar/DayView.tsx
function DayView({ startHour = 0, endHour = 24, onEventClick, onEventCopy, onEventDelete, onEventEdit }) {
	const { events, selectedDate, selectEvent } = useCalendarContext();
	const { now, top: timeMarkerTop, visible: showMarker } = useCurrentTime(startHour, endHour, isToday(selectedDate));
	const handleEventClick = (event) => {
		selectEvent(event.id);
		onEventClick?.(event);
	};
	return /* @__PURE__ */ jsxs("div", {
		"data-slot": "day-view",
		role: "region",
		"aria-label": "Day calendar",
		className: "flex flex-col @[768px]:flex-row",
		children: [/* @__PURE__ */ jsx("div", {
			className: "min-w-0 flex-1",
			children: /* @__PURE__ */ jsxs(TimeGrid, {
				startHour,
				endHour,
				children: [/* @__PURE__ */ jsx(DayColumn, {
					date: selectedDate,
					events,
					startHour,
					endHour,
					onEventClick: handleEventClick
				}), showMarker && /* @__PURE__ */ jsx(CurrentTimeMarker, {
					top: timeMarkerTop,
					now
				})]
			})
		}), /* @__PURE__ */ jsxs("section", {
			"aria-label": "Day sidebar",
			className: "flex shrink-0 flex-col overflow-y-auto border-t border-border @[768px]:w-96 @[768px]:border-l @[768px]:border-t-0",
			children: [/* @__PURE__ */ jsx(MiniMonthCalendar, {}), /* @__PURE__ */ jsx(EventDetailPanel, {
				onEventCopy,
				onEventDelete,
				onEventEdit
			})]
		})]
	});
}
DayView.displayName = "DayView";
//#endregion
export { DayView };

//# sourceMappingURL=index68.js.map