import { jsx as e } from "react/jsx-runtime";
import { memo as p } from "react";
import { useGetShikiHighlightedHtml as m } from "../../hooks/use-get-shiki-highlighted-html.js";
import { SHIKI_CLASSNAME as s } from "../../utils/shiki/constants.js";
const a = p(
  ({ language: r, children: t, codeBlockThemeObject: i }) => {
    const n = typeof t == "string" ? t : "";
    r = r ?? "text";
    const o = m({
      codeString: n,
      codeBlockTheme: i,
      language: r,
      opts: { structure: "inline" }
    });
    return typeof t == "string" && r && o ? /* @__PURE__ */ e("pre", { className: s, suppressHydrationWarning: !0, children: /* @__PURE__ */ e(
      "code",
      {
        dangerouslySetInnerHTML: { __html: o },
        suppressHydrationWarning: !0
      }
    ) }) : /* @__PURE__ */ e("pre", { className: s, suppressHydrationWarning: !0, children: /* @__PURE__ */ e("code", { suppressHydrationWarning: !0, children: t }) });
  }
);
export {
  a as CodeSnippet
};
