const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_objectWithoutProperties = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/pisellLayout/sider.tsx
const _excluded = [
	"children",
	"collapsible",
	"collapsed",
	"onCollapse"
];
const { Sider } = antd.Layout;
const PisellSider = (props) => {
	const { children, collapsible, collapsed, onCollapse } = props, rest = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
	const [collapsedState, setCollapsedState] = (0, react.useState)(collapsed);
	const className = (0, classnames.default)("pisell-layout-sider", props.className);
	const _onCollapse = (val, type) => {
		onCollapse === null || onCollapse === void 0 || onCollapse(val, type);
		setCollapsedState(val);
	};
	(0, react.useEffect)(() => {
		setCollapsedState(collapsed);
	}, [collapsed]);
	return /* @__PURE__ */ react.default.createElement(Sider, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, rest), {}, {
		collapsible,
		collapsed: collapsedState,
		onCollapse: _onCollapse,
		className
	}), /* @__PURE__ */ react.default.createElement("div", {
		className: "pisell-layout-sider-content",
		style: {
			overflowY: "auto",
			height: "100%"
		}
	}, children));
};
//#endregion
exports.default = PisellSider;
