const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
const require_utils = require("../utils.js");
let react = require("react");
react = require_runtime.__toESM(react);
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/select-time/RightPanel/index.tsx
const RightPanel = (props) => {
	const { value, onChange, slice = 5 } = props;
	const list = (0, react.useMemo)(() => {
		return require_utils.sliceDayIntoFiveMinutes(slice);
	}, [slice]);
	(0, react.useEffect)(() => {
		console.log(require_utils.findNextSlice({
			timeSlices: list,
			date: value
		}));
		let nextTime = require_utils.findNextSlice({
			timeSlices: list,
			date: value
		});
		let scrollDom = document.querySelector(".select-time-right-panel-list");
		const timeDom = document.querySelector(`#time${nextTime.replace(":", "")}`);
		if (scrollDom && timeDom) scrollDom.scrollTop = timeDom.offsetTop;
	}, [value]);
	return /* @__PURE__ */ react.default.createElement("div", { className: "select-time-right-panel" }, /* @__PURE__ */ react.default.createElement("div", { className: "select-time-right-panel-list" }, list.map((d) => {
		return /* @__PURE__ */ react.default.createElement("div", {
			className: (0, classnames.default)("select-time-right-panel-item", { "select-time-right-panel-item-active": d.value === value }),
			key: d.value,
			id: "time" + d.value.replace(":", ""),
			onClick: () => {
				onChange(d.value);
			}
		}, d.label);
	})));
};
//#endregion
exports.default = RightPanel;
