import { c } from "react-compiler-runtime";
import React from "react";
import { Button, CircularProgress, makeStyles } from "@material-ui/core";
//#region src/UI/inputs/buttons/FluentButton.jsx
const useStyles = makeStyles((theme) => ({
	root: {
		borderRadius: 2,
		height: (props) => props.height ? props.height : 32,
		padding: "0 16px",
		minWidth: (props) => props.minWidth ? props.minWidth : 80,
		border: (props) => `1px solid ${props.color}`
	},
	label: {
		textTransform: "capitalize",
		fontSize: "0.875rem",
		fontWeight: 600
	}
}));
const FluentButton = (props) => {
	const $ = c(24);
	const classes = useStyles(props);
	let children;
	let disabled;
	let id;
	let minWidth;
	let otherProps;
	let progress;
	let udprecordid;
	if ($[0] !== props) {
		({children, id, udprecordid, minWidth, progress, disabled, ...otherProps} = props);
		$[0] = props;
		$[1] = children;
		$[2] = disabled;
		$[3] = id;
		$[4] = minWidth;
		$[5] = otherProps;
		$[6] = progress;
		$[7] = udprecordid;
	} else {
		children = $[1];
		disabled = $[2];
		id = $[3];
		minWidth = $[4];
		otherProps = $[5];
		progress = $[6];
		udprecordid = $[7];
	}
	let t0;
	if ($[8] !== classes.label || $[9] !== classes.root) {
		t0 = {
			root: classes.root,
			label: classes.label
		};
		$[8] = classes.label;
		$[9] = classes.root;
		$[10] = t0;
	} else t0 = $[10];
	const t1 = disabled || progress;
	let t2;
	if ($[11] !== id || $[12] !== progress || $[13] !== udprecordid) {
		t2 = progress && /* @__PURE__ */ React.createElement(CircularProgress, {
			id: id + "-ButtonProgress",
			udprecordid: udprecordid + "-ButtonProgress",
			size: 18,
			color: "primary"
		});
		$[11] = id;
		$[12] = progress;
		$[13] = udprecordid;
		$[14] = t2;
	} else t2 = $[14];
	const t3 = !progress && children;
	let t4;
	if ($[15] !== id || $[16] !== minWidth || $[17] !== otherProps || $[18] !== t0 || $[19] !== t1 || $[20] !== t2 || $[21] !== t3 || $[22] !== udprecordid) {
		t4 = /* @__PURE__ */ React.createElement(Button, {
			...otherProps,
			disableElevation: true,
			classes: t0,
			margin: "dense",
			id,
			udprecordid,
			minWidth,
			disabled: t1
		}, t2, t3);
		$[15] = id;
		$[16] = minWidth;
		$[17] = otherProps;
		$[18] = t0;
		$[19] = t1;
		$[20] = t2;
		$[21] = t3;
		$[22] = udprecordid;
		$[23] = t4;
	} else t4 = $[23];
	return t4;
};
//#endregion
export { FluentButton };

//# sourceMappingURL=FluentButton.mjs.map