import { c } from "react-compiler-runtime";
import React from "react";
import { makeStyles } from "@material-ui/core";
import PropTypes from "prop-types";
//#region src/UI/inputs/pickers/UdpDateSelector.jsx
const useStyles = makeStyles((theme) => ({ dateInput: {
	borderRadius: 2,
	height: 32,
	padding: theme.spacing(1),
	margin: theme.spacing(1),
	fontSize: 14,
	border: "1px solid #ced4da",
	backgroundColor: "transparent",
	"&:focus": {
		borderColor: theme.palette.primary.main,
		outline: "none"
	}
} }));
const UdpDateSelector = (props) => {
	const $ = c(17);
	const classes = useStyles();
	let id;
	let label;
	let otherProps;
	let selectedDate;
	let t0;
	if ($[0] !== props) {
		const { id: t1, udprecordid, label: t2, handleDateChange: onChangeProp, selectedDate: t3, ...t4 } = props;
		id = t1;
		label = t2;
		selectedDate = t3;
		otherProps = t4;
		t0 = (event) => onChangeProp?.(event.target.value);
		$[0] = props;
		$[1] = id;
		$[2] = label;
		$[3] = otherProps;
		$[4] = selectedDate;
		$[5] = t0;
	} else {
		id = $[1];
		label = $[2];
		otherProps = $[3];
		selectedDate = $[4];
		t0 = $[5];
	}
	const onChange = t0;
	let t1;
	if ($[6] !== classes.dateInput || $[7] !== id || $[8] !== onChange || $[9] !== otherProps || $[10] !== selectedDate) {
		t1 = /* @__PURE__ */ React.createElement("input", {
			type: "date",
			id,
			className: classes.dateInput,
			value: selectedDate,
			onChange,
			...otherProps
		});
		$[6] = classes.dateInput;
		$[7] = id;
		$[8] = onChange;
		$[9] = otherProps;
		$[10] = selectedDate;
		$[11] = t1;
	} else t1 = $[11];
	let t2;
	if ($[12] !== classes.labelRoot || $[13] !== id || $[14] !== label || $[15] !== t1) {
		t2 = /* @__PURE__ */ React.createElement("label", {
			htmlFor: id,
			className: classes.labelRoot
		}, label, t1);
		$[12] = classes.labelRoot;
		$[13] = id;
		$[14] = label;
		$[15] = t1;
		$[16] = t2;
	} else t2 = $[16];
	return t2;
};
UdpDateSelector.propTypes = {
	label: PropTypes.string.isRequired,
	id: PropTypes.string.isRequired,
	handleDateChange: PropTypes.func,
	selectedDate: PropTypes.string
};
//#endregion
export { UdpDateSelector as default };

//# sourceMappingURL=UdpDateSelector.mjs.map