import ReadOnlyView from "./components/ReadOnlyView.js";
import EditView from "./components/EditView.js";
import DisabledView from "./components/DisabledView.js";
import React from "react";
import { getDisplayState } from "@pisell/utils";
import "./PisellPercent.less";
//#region src/components/pisellPercent/PisellPercent.tsx
/**
* PisellPercent 百分比组件
* 
* 基于 PisellNumber 派生，专门处理百分比数据。
* 支持文本、进度条、环形进度三种展示变体。
* 
* @param props 组件 Props
* 
* @example
* // 基础使用
* const [value, setValue] = useState(85.5);
* <PisellPercent 
*   value={value}
*   onChange={setValue}
* />
* 
* @example
* // 进度条展示
* <PisellPercent 
*   mode="read"
*   value={75}
*   variant="progress"
* />
* 
* @example
* // 滑块 + 输入框
* <PisellPercent 
*   value={value}
*   onChange={setValue}
*   showSlider
* />
*/
const PisellPercent = (props) => {
	const { mode = "edit", disabled = false } = props;
	switch (getDisplayState(mode, disabled)) {
		case "read": return /* @__PURE__ */ React.createElement(ReadOnlyView, props);
		case "edit": return /* @__PURE__ */ React.createElement(EditView, props);
		case "disabled": return /* @__PURE__ */ React.createElement(DisabledView, props);
		default: return null;
	}
};
const MemoizedPisellPercent = React.memo(PisellPercent, (prevProps, nextProps) => {
	return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled && prevProps.variant === nextProps.variant;
});
//#endregion
export { MemoizedPisellPercent as default };
