import { Link } from "../Link/Link.mjs";
import { H1, H2, H3, H4, H5, H6 } from "../Headers/index.mjs";
import { Fragment, jsx } from "react/jsx-runtime";
import { renderHTML } from "react-intlayer";

//#region src/components/HTMLRender/HTMLRender.tsx
const getIntlayerHTMLOptions = () => ({ components: {
	h1: (props) => /* @__PURE__ */ jsx(H1, {
		isClickable: true,
		...props
	}),
	h2: (props) => /* @__PURE__ */ jsx(H2, {
		isClickable: true,
		className: "mt-16",
		...props
	}),
	h3: (props) => /* @__PURE__ */ jsx(H3, {
		isClickable: true,
		className: "mt-5",
		...props
	}),
	h4: (props) => /* @__PURE__ */ jsx(H4, {
		isClickable: true,
		className: "mt-3",
		...props
	}),
	h5: (props) => /* @__PURE__ */ jsx(H5, {
		isClickable: true,
		className: "mt-3",
		...props
	}),
	h6: (props) => /* @__PURE__ */ jsx(H6, {
		isClickable: true,
		className: "mt-3",
		...props
	}),
	a: (props) => /* @__PURE__ */ jsx(Link, {
		color: "neutral",
		isExternalLink: props.href?.startsWith("http"),
		underlined: true,
		...props
	})
} });
/**
* HTMLRenderer Component
*
* A comprehensive HTML renderer that transforms HTML text into rich,
* interactive content with custom styling and Intlayer integration.
*/
const HTMLRenderer = ({ children, isDarkMode, locale, components: componentsProp }) => {
	return /* @__PURE__ */ jsx(Fragment, { children: renderHTML(children, { components: {
		...getIntlayerHTMLOptions(isDarkMode ?? false).components,
		a: (props) => /* @__PURE__ */ jsx(Link, {
			color: "neutral",
			isExternalLink: props.href?.startsWith("http"),
			underlined: true,
			locale,
			...props
		}),
		...componentsProp
	} }) });
};

//#endregion
export { HTMLRenderer, getIntlayerHTMLOptions };
//# sourceMappingURL=HTMLRender.mjs.map