import { tCal } from "../calendarI18n.js";
import React from "react";
import { DatePicker } from "antd";
import { CloseOutlined } from "@ant-design/icons";
//#region src/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarBlockPanel.tsx
const { RangePicker } = DatePicker;
/**
* 内置锁台 / 屏蔽时间表单（宿主未传 `onBlockedTimePanelRequest` 时使用）。
*/
function BookingCalendarBlockPanel({ blockPanelRef, isLight, blockFormName, setBlockFormName, blockModalNote, setBlockModalNote, blockResourceId, setBlockResourceId, blockTimeRange, setBlockTimeRange, resolvedSlotMinutes, visibleCourts, blockSaving, onClose, onSave }) {
	return /* @__PURE__ */ React.createElement("div", { className: "fixed inset-0 z-50 bg-black/55 backdrop-blur-sm flex items-end md:items-center justify-center p-2 md:p-4" }, /* @__PURE__ */ React.createElement("div", {
		ref: blockPanelRef,
		className: `w-full max-w-[720px] max-h-[92vh] overflow-y-auto rounded-t-3xl md:rounded-3xl border p-4 md:p-6 shadow-2xl ${isLight ? "theme-panel theme-border soft-shadow" : "border-zinc-700 bg-[#121217]"}`
	}, /* @__PURE__ */ React.createElement("div", { className: "mb-4 flex items-center justify-between gap-3" }, /* @__PURE__ */ React.createElement("div", { className: "text-xl font-semibold" }, tCal("pisell2.recordBoard.calendar.block.panelTitle")), /* @__PURE__ */ React.createElement("button", {
		type: "button",
		"aria-label": tCal("pisell2.recordBoard.calendar.block.closeAria"),
		onClick: onClose,
		className: `rounded-xl p-2 ${isLight ? "btn-neutral" : "border border-zinc-700 text-zinc-300"}`
	}, /* @__PURE__ */ React.createElement(CloseOutlined, { style: { fontSize: 20 } }))), /* @__PURE__ */ React.createElement("div", { className: `space-y-4 rounded-2xl border p-4 ${isLight ? "theme-panel-alt theme-border" : "border-zinc-700 bg-[#171820]"}` }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", { className: `mb-2 block text-sm ${isLight ? "theme-text-muted" : "text-zinc-400"}` }, tCal("pisell2.recordBoard.calendar.block.fieldTitle")), /* @__PURE__ */ React.createElement("input", {
		value: blockFormName,
		onChange: (e) => setBlockFormName(e.target.value),
		placeholder: tCal("pisell2.recordBoard.calendar.block.placeholderTitle"),
		className: `w-full rounded-xl px-3 py-2 outline-none ${isLight ? "theme-input theme-text" : "border border-zinc-700 bg-[#111218] text-white"}`
	})), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", { className: `mb-2 block text-sm ${isLight ? "theme-text-muted" : "text-zinc-400"}` }, "备注"), /* @__PURE__ */ React.createElement("input", {
		value: blockModalNote,
		onChange: (e) => setBlockModalNote(e.target.value),
		placeholder: "选填",
		className: `w-full rounded-xl px-3 py-2 outline-none ${isLight ? "theme-input theme-text" : "border border-zinc-700 bg-[#111218] text-white"}`
	})), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", { className: `mb-2 block text-sm ${isLight ? "theme-text-muted" : "text-zinc-400"}` }, tCal("pisell2.recordBoard.calendar.block.fieldResource")), /* @__PURE__ */ React.createElement("select", {
		value: blockResourceId,
		onChange: (e) => setBlockResourceId(e.target.value),
		className: `w-full rounded-xl px-3 py-2 outline-none ${isLight ? "theme-input theme-text" : "border border-zinc-700 bg-[#111218] text-white"}`
	}, /* @__PURE__ */ React.createElement("option", { value: "" }, tCal("pisell2.recordBoard.calendar.block.noResource")), visibleCourts.map((c) => /* @__PURE__ */ React.createElement("option", {
		key: c.id,
		value: String(c.id)
	}, c.name)))), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", { className: `mb-2 block text-sm ${isLight ? "theme-text-muted" : "text-zinc-400"}` }, tCal("pisell2.recordBoard.calendar.block.fieldTimeRange")), /* @__PURE__ */ React.createElement(RangePicker, {
		style: { width: "100%" },
		showTime: {
			format: "HH:mm",
			minuteStep: resolvedSlotMinutes >= 60 ? 60 : Math.max(1, resolvedSlotMinutes)
		},
		format: "YYYY-MM-DD HH:mm",
		value: blockTimeRange !== null && blockTimeRange !== void 0 ? blockTimeRange : void 0,
		onChange: (v) => {
			var _ref;
			return setBlockTimeRange((_ref = v) !== null && _ref !== void 0 ? _ref : null);
		}
	}))), /* @__PURE__ */ React.createElement("div", { className: "mt-6 flex flex-col-reverse sm:flex-row items-stretch sm:items-center justify-end gap-3" }, /* @__PURE__ */ React.createElement("button", {
		type: "button",
		disabled: blockSaving,
		onClick: onClose,
		className: `rounded-xl px-4 py-2 ${isLight ? "btn-neutral" : "border border-zinc-700 text-zinc-300"}`
	}, tCal("pisell2.recordBoard.calendar.common.cancel")), /* @__PURE__ */ React.createElement("button", {
		type: "button",
		disabled: blockSaving,
		onClick: () => void onSave(),
		className: `rounded-xl px-5 py-3 text-sm font-semibold disabled:opacity-50 ${isLight ? "btn-brand" : "bg-violet-600 text-white"}`
	}, blockSaving ? tCal("pisell2.recordBoard.calendar.common.saving") : tCal("pisell2.recordBoard.calendar.common.save")))));
}
//#endregion
export { BookingCalendarBlockPanel };
