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