import { LogViewer as e } from "../../editors/log-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/log-viewer.tsx
function i({ lines: i, className: a, ...o }) {
	let s = n.useRef(null), c = n.useRef(null), l = n.useRef(0);
	return n.useEffect(() => {
		if (!(typeof document > "u" || !s.current)) return c.current = new e({
			...o,
			container: s.current
		}), () => {
			c.current?.destroy(), c.current = null, l.current = 0;
		};
	}, []), n.useEffect(() => {
		let e = c.current;
		if (!e || !i) return;
		let t = i.slice(l.current);
		t.length !== 0 && (e.appendLines(t), l.current = i.length);
	}, [i]), /* @__PURE__ */ r("div", {
		ref: s,
		"data-slot": "log-viewer",
		className: t("w-full", a)
	});
}
i.displayName = "LogViewer";
//#endregion
export { i as LogViewer };

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