import { DiffViewer as e } from "../../editors/diff-viewer.js";
import { t } from "../../utils-B7XIe3qq.js";
import * as n from "react";
import { jsx as r } from "react/jsx-runtime";
//#region src/react/editors/diff-viewer.tsx
function i({ original: i, modified: a, className: o, ...s }) {
	let c = n.useRef(null), l = n.useRef(null);
	return n.useEffect(() => {
		if (!(typeof document > "u" || !c.current)) return l.current = new e({
			...s,
			container: c.current,
			original: i,
			modified: a
		}), () => {
			l.current?.destroy(), l.current = null;
		};
	}, []), n.useEffect(() => {
		l.current && l.current.setContent(i, a);
	}, [i, a]), /* @__PURE__ */ r("div", {
		ref: c,
		"data-slot": "diff-viewer",
		className: t("w-full", o)
	});
}
i.displayName = "DiffViewer";
//#endregion
export { i as DiffViewer };

//# sourceMappingURL=diff-viewer.js.map