import { FluentIconButton } from "../../../inputs/buttons/FluentIconButton.mjs";
import { LayoutUnit } from "../../../../layout/LayoutUnit.mjs";
import { AmbientCard } from "../AmbientCard/AmbientCard.mjs";
import { WorkOrderHeader } from "./WorkOrderHeader.mjs";
import { c } from "react-compiler-runtime";
import React, { useState } from "react";
import { Collapse, makeStyles } from "@material-ui/core";
import { ChevronDownIcon, ChevronUpIcon } from "@fluentui/react-icons";
//#region src/UI/surfaces/cards/workOrderCard/WorkOrderCard.jsx
const useStyles = makeStyles((theme) => ({
	root: {},
	moreButton: { display: "flex" }
}));
const WorkOrderCard = (t0) => {
	const $ = c(35);
	const { title, onClick, status, label, cost, hours, service, list, extendedList, launch } = t0;
	const classes = useStyles();
	const [expanded, setExpanded] = useState(false);
	let t1;
	if ($[0] !== cost || $[1] !== hours || $[2] !== service) {
		t1 = cost && /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(WorkOrderHeader, {
			cost,
			hours
		})), /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "sm" }), service, /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "sm" }));
		$[0] = cost;
		$[1] = hours;
		$[2] = service;
		$[3] = t1;
	} else t1 = $[3];
	let t2;
	if ($[4] !== cost || $[5] !== service) {
		t2 = !cost && /* @__PURE__ */ React.createElement("div", null, " ", service);
		$[4] = cost;
		$[5] = service;
		$[6] = t2;
	} else t2 = $[6];
	let t3;
	if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
		t3 = /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "xxs" });
		$[7] = t3;
	} else t3 = $[7];
	let t4;
	if ($[8] !== classes.icon || $[9] !== classes.moreButton || $[10] !== expanded || $[11] !== extendedList) {
		t4 = extendedList && /* @__PURE__ */ React.createElement("div", { className: classes.moreButton }, /* @__PURE__ */ React.createElement(FluentIconButton, {
			onClick: () => setExpanded(!expanded),
			icon: expanded ? ChevronUpIcon : ChevronDownIcon,
			className: classes.icon
		}));
		$[8] = classes.icon;
		$[9] = classes.moreButton;
		$[10] = expanded;
		$[11] = extendedList;
		$[12] = t4;
	} else t4 = $[12];
	let t5;
	if ($[13] !== extendedList) {
		t5 = /* @__PURE__ */ React.createElement("div", null, extendedList);
		$[13] = extendedList;
		$[14] = t5;
	} else t5 = $[14];
	let t6;
	if ($[15] !== expanded || $[16] !== t5) {
		t6 = /* @__PURE__ */ React.createElement(Collapse, {
			in: expanded,
			timeout: "auto"
		}, t5);
		$[15] = expanded;
		$[16] = t5;
		$[17] = t6;
	} else t6 = $[17];
	let t7;
	if ($[18] !== list || $[19] !== t4 || $[20] !== t6) {
		t7 = /* @__PURE__ */ React.createElement("div", null, list, t3, t4, t6);
		$[18] = list;
		$[19] = t4;
		$[20] = t6;
		$[21] = t7;
	} else t7 = $[21];
	let t8;
	if ($[22] !== expanded || $[23] !== label || $[24] !== launch || $[25] !== onClick || $[26] !== status || $[27] !== t1 || $[28] !== t2 || $[29] !== t7 || $[30] !== title) {
		t8 = /* @__PURE__ */ React.createElement(AmbientCard, {
			title,
			onClick,
			ariaLabel: "launch",
			fullWidth: true,
			status,
			label,
			launch,
			extendedContent: expanded
		}, t1, t2, t7);
		$[22] = expanded;
		$[23] = label;
		$[24] = launch;
		$[25] = onClick;
		$[26] = status;
		$[27] = t1;
		$[28] = t2;
		$[29] = t7;
		$[30] = title;
		$[31] = t8;
	} else t8 = $[31];
	let t9;
	if ($[32] !== classes.root || $[33] !== t8) {
		t9 = /* @__PURE__ */ React.createElement("div", { className: classes.root }, t8);
		$[32] = classes.root;
		$[33] = t8;
		$[34] = t9;
	} else t9 = $[34];
	return t9;
};
//#endregion
export { WorkOrderCard };

//# sourceMappingURL=WorkOrderCard.mjs.map