import { Typography } from "../../../UI/dataDisplay/typography/Typography.mjs";
import { LayoutUnit } from "../../../layout/LayoutUnit.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { useTranslation } from "react-i18next";
//#region src/utilities/form/paymentForm/HostedPaymentError.tsx
/**
* @file HostedPaymentError.tsx
* @description This component displays an error message when there is an issue rendering the hosted payment form.
*/
/**
* HostedPaymentError component
* 
* This component is used to display an error message when there is an issue rendering the hosted payment form.
* It utilizes the `useTranslation` hook to support internationalization.
* 
* @param {Object} props - The properties object.
* @param {string} props.error - The error string.
* @param {string} props.message - The error message to be displayed.
* 
* @returns {JSX.Element} The rendered error message component.
*/
const HostedPaymentError = (t0) => {
	const $ = c(13);
	const { message } = t0;
	const { t } = useTranslation();
	let t1;
	if ($[0] !== t) {
		t1 = t("There was an error rendering the hosted payment form. Please check your settings and try again");
		$[0] = t;
		$[1] = t1;
	} else t1 = $[1];
	let t2;
	if ($[2] !== t1) {
		t2 = /* @__PURE__ */ React.createElement(Typography, {
			variant: "subtitle1",
			color: "error"
		}, t1, ":");
		$[2] = t1;
		$[3] = t2;
	} else t2 = $[3];
	let t3;
	if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
		t3 = /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "xxs" });
		$[4] = t3;
	} else t3 = $[4];
	let t4;
	if ($[5] !== t) {
		t4 = t("Error");
		$[5] = t;
		$[6] = t4;
	} else t4 = $[6];
	let t5;
	if ($[7] !== message || $[8] !== t4) {
		t5 = /* @__PURE__ */ React.createElement(Typography, {
			variant: "body1",
			color: "error"
		}, t4, ": ", message);
		$[7] = message;
		$[8] = t4;
		$[9] = t5;
	} else t5 = $[9];
	let t6;
	if ($[10] !== t2 || $[11] !== t5) {
		t6 = /* @__PURE__ */ React.createElement(React.Fragment, null, t2, t3, t5);
		$[10] = t2;
		$[11] = t5;
		$[12] = t6;
	} else t6 = $[12];
	return t6;
};
//#endregion
export { HostedPaymentError };

//# sourceMappingURL=HostedPaymentError.mjs.map