import { cn } from "../../utils/cn.mjs";
import { Suspense, lazy } from "react";
import { jsx } from "react/jsx-runtime";

//#region src/components/IDE/CodeBlockClient.tsx
const CodeDefault = ({ children }) => /* @__PURE__ */ jsx("div", {
	className: "min-w-0 max-w-full overflow-x-auto",
	children: /* @__PURE__ */ jsx("pre", {
		className: "min-w-0 max-w-full overflow-x-auto",
		children: /* @__PURE__ */ jsx("code", { children: children.split("\n").map((line, index) => /* @__PURE__ */ jsx("span", {
			className: "line block w-full",
			children: line
		}, `line-${index}-${line.slice(0, 10)}`)) })
	})
});
const CodeBlockShiki = lazy(() => import("./CodeBlockShiki.mjs").then((mod) => ({ default: mod.CodeBlockShiki })));
const CodeBlock = ({ className, onChange, isEditable, children, lang, isDarkMode, ...props }) => /* @__PURE__ */ jsx("div", {
	className: cn("flex w-full min-w-0 max-w-full overflow-x-auto", className),
	...props,
	children: /* @__PURE__ */ jsx(Suspense, {
		fallback: /* @__PURE__ */ jsx(CodeDefault, { children }),
		children: /* @__PURE__ */ jsx(CodeBlockShiki, {
			lang,
			isDarkMode,
			children
		})
	})
});

//#endregion
export { CodeBlock, CodeDefault };
//# sourceMappingURL=CodeBlockClient.mjs.map