import { useEffect, useState } from "react";
//#region src/components/PisellCards/components/MultilevelCard/hooks/useMultilevelCardExpand.ts
/**
* 展开/收起状态管理 Hook
* @param options - 配置选项
* @returns 展开状态和设置函数
*/
const useMultilevelCardExpand = (options) => {
	const { active, trigger, onExpandChange, __designMode } = options;
	const [expanded, setExpanded] = useState(__designMode ? true : false);
	useEffect(() => {
		if (trigger === "click") setExpanded(!!(active === null || active === void 0 ? void 0 : active.value));
	}, [active === null || active === void 0 ? void 0 : active.value, trigger]);
	useEffect(() => {
		onExpandChange === null || onExpandChange === void 0 || onExpandChange(expanded);
	}, [expanded, onExpandChange]);
	return {
		expanded,
		setExpanded
	};
};
//#endregion
export { useMultilevelCardExpand };
