import { NotificationElement } from "./NotificationElement.mjs";
import { StatusLineItem } from "./StatusLineItem.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Card, CardContent, Typography, makeStyles } from "@material-ui/core";
import PropTypes from "prop-types";
//#region src/UI/dataDisplay/ticketCard/TicketCard.jsx
const useStyles = makeStyles((theme) => ({
	root: { display: "flex" },
	overviewContainer: {
		width: theme.spacing(16),
		height: theme.spacing(16),
		background: "#393939",
		marginRight: theme.spacing(2),
		position: "relative"
	},
	notification: {
		position: "absolute",
		right: 0,
		top: 0
	},
	totalNumber: {
		textAlign: "center",
		color: "#FFFFFF",
		fontWeight: 400
	},
	label: {
		display: "flex",
		justifyContent: "center",
		marginTop: -8,
		color: "#FFFFFF"
	},
	itemContainer: {
		width: "100%",
		display: "flex",
		flexDirection: "column",
		alignContent: "space-around",
		marginTop: theme.spacing(.5)
	}
}));
const TicketCard = (t0) => {
	const $ = c(27);
	const { totalAmount, label, notification, alertNumber, ticketData, component: t1 } = t0;
	const component = t1 === void 0 ? "h6" : t1;
	const classes = useStyles();
	let t2;
	if ($[0] !== classes.totalNumber || $[1] !== component || $[2] !== totalAmount) {
		t2 = /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(Typography, {
			variant: "h1",
			component,
			className: classes.totalNumber
		}, totalAmount));
		$[0] = classes.totalNumber;
		$[1] = component;
		$[2] = totalAmount;
		$[3] = t2;
	} else t2 = $[3];
	let t3;
	if ($[4] !== label) {
		t3 = /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, label, " ");
		$[4] = label;
		$[5] = t3;
	} else t3 = $[5];
	let t4;
	if ($[6] !== classes.label || $[7] !== t3) {
		t4 = /* @__PURE__ */ React.createElement("div", { className: classes.label }, t3);
		$[6] = classes.label;
		$[7] = t3;
		$[8] = t4;
	} else t4 = $[8];
	let t5;
	if ($[9] !== alertNumber || $[10] !== classes.notification || $[11] !== notification) {
		t5 = notification && /* @__PURE__ */ React.createElement("div", { className: classes.notification }, /* @__PURE__ */ React.createElement(NotificationElement, { alertNumber }));
		$[9] = alertNumber;
		$[10] = classes.notification;
		$[11] = notification;
		$[12] = t5;
	} else t5 = $[12];
	let t6;
	if ($[13] !== classes.overviewContainer || $[14] !== t2 || $[15] !== t4 || $[16] !== t5) {
		t6 = /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Card, {
			elevation: 0,
			square: true,
			className: classes.overviewContainer
		}, t2, t4, t5));
		$[13] = classes.overviewContainer;
		$[14] = t2;
		$[15] = t4;
		$[16] = t5;
		$[17] = t6;
	} else t6 = $[17];
	let t7;
	if ($[18] !== ticketData) {
		t7 = ticketData && ticketData.map(_temp);
		$[18] = ticketData;
		$[19] = t7;
	} else t7 = $[19];
	let t8;
	if ($[20] !== classes.itemContainer || $[21] !== t7) {
		t8 = /* @__PURE__ */ React.createElement("div", { className: classes.itemContainer }, t7);
		$[20] = classes.itemContainer;
		$[21] = t7;
		$[22] = t8;
	} else t8 = $[22];
	let t9;
	if ($[23] !== classes.root || $[24] !== t6 || $[25] !== t8) {
		t9 = /* @__PURE__ */ React.createElement("div", { className: classes.root }, t6, t8);
		$[23] = classes.root;
		$[24] = t6;
		$[25] = t8;
		$[26] = t9;
	} else t9 = $[26];
	return t9;
};
TicketCard.propTypes = {
	totalAmount: PropTypes.number,
	label: PropTypes.string.isRequired,
	notification: PropTypes.bool,
	alertNumber: PropTypes.number,
	ticketData: PropTypes.arrayOf(PropTypes.shape({
		ticketAmount: PropTypes.string.isRequired,
		label: PropTypes.number.isRequired,
		notification: PropTypes.number.isRequired,
		alertNumber: PropTypes.number,
		id: PropTypes.number.isRequired,
		ticketData: PropTypes.arrayOf(PropTypes.shape({
			label: PropTypes.string.isRequired,
			amount: PropTypes.number,
			status: PropTypes.string.isRequired,
			icon: PropTypes.node
		}))
	}).isRequired).isRequired,
	component: PropTypes.string
};
TicketCard.defaultProps = { component: "h2" };
function _temp(item) {
	return /* @__PURE__ */ React.createElement(StatusLineItem, {
		label: item.label,
		amount: item.amount,
		status: item.status === "error" && "error",
		icon: item.icon,
		key: item.id
	});
}
//#endregion
export { TicketCard };

//# sourceMappingURL=TicketCard.mjs.map