import { c } from "react-compiler-runtime";
import React from "react";
import { Card, CardContent, Typography, makeStyles } from "@material-ui/core";
//#region src/chatBot/ChatMessage.jsx
const useStyles = makeStyles((theme) => ({
	root: {
		borderRadius: 5,
		background: (props) => props.message.outgoing ? "#cdecfa" : "#e1e2e3",
		width: "85%",
		padding: "3px",
		alignSelf: (props) => props.message.outgoing && "flex-end",
		flexShrink: 0,
		boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
	},
	userName: { fontWeight: "bold" },
	timestamp: {
		color: "#A9A9A9",
		margin: "0 0 0 5px"
	}
}));
const ChatMessage = (props) => {
	const $ = c(21);
	const classes = useStyles(props);
	const { message } = props;
	let t0;
	if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
		t0 = {
			display: "flex",
			flexDirection: "row"
		};
		$[0] = t0;
	} else t0 = $[0];
	let t1;
	if ($[1] !== classes.userName || $[2] !== message.createdBy.name) {
		t1 = /* @__PURE__ */ React.createElement(Typography, {
			noWrap: true,
			variant: "caption",
			className: classes.userName
		}, message.createdBy.name);
		$[1] = classes.userName;
		$[2] = message.createdBy.name;
		$[3] = t1;
	} else t1 = $[3];
	let t2;
	if ($[4] !== classes.timestamp || $[5] !== message.createdAt || $[6] !== message.createdBy.loading) {
		t2 = !message.createdBy.loading && /* @__PURE__ */ React.createElement(Typography, {
			noWrap: true,
			variant: "caption",
			className: classes.timestamp
		}, message.createdAt);
		$[4] = classes.timestamp;
		$[5] = message.createdAt;
		$[6] = message.createdBy.loading;
		$[7] = t2;
	} else t2 = $[7];
	let t3;
	if ($[8] !== t1 || $[9] !== t2) {
		t3 = /* @__PURE__ */ React.createElement("div", { style: t0 }, t1, t2);
		$[8] = t1;
		$[9] = t2;
		$[10] = t3;
	} else t3 = $[10];
	let t4;
	if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
		t4 = { wordWrap: "break-word" };
		$[11] = t4;
	} else t4 = $[11];
	let t5;
	if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
		t5 = { whiteSpace: "pre-line" };
		$[12] = t5;
	} else t5 = $[12];
	let t6;
	if ($[13] !== message.messageContent) {
		t6 = /* @__PURE__ */ React.createElement("div", { style: t4 }, /* @__PURE__ */ React.createElement(Typography, {
			variant: "body2",
			style: t5
		}, message.messageContent));
		$[13] = message.messageContent;
		$[14] = t6;
	} else t6 = $[14];
	let t7;
	if ($[15] !== t3 || $[16] !== t6) {
		t7 = /* @__PURE__ */ React.createElement(CardContent, null, t3, t6);
		$[15] = t3;
		$[16] = t6;
		$[17] = t7;
	} else t7 = $[17];
	let t8;
	if ($[18] !== classes.root || $[19] !== t7) {
		t8 = /* @__PURE__ */ React.createElement(Card, { className: classes.root }, t7);
		$[18] = classes.root;
		$[19] = t7;
		$[20] = t8;
	} else t8 = $[20];
	return t8;
};
//#endregion
export { ChatMessage };

//# sourceMappingURL=ChatMessage.mjs.map