import { useState as l, useEffect as a } from "react";
import { codeToHtml as f } from "shiki";
import { a as n } from "./index-Bk6WqXgW.mjs";
function p(s, o) {
  const r = n(), [u, i] = l(""), [h, e] = l(!0);
  return a(() => {
    let t = !1;
    return e(!0), f(s, {
      lang: o,
      theme: r === "light" ? "github-light" : "dark-plus"
    }).then((m) => {
      t || (i(m), e(!1));
    }).catch(() => {
      t || (i(""), e(!1));
    }), () => {
      t = !0;
    };
  }, [s, o, r]), { html: u, loading: h };
}
export {
  p as u
};
//# sourceMappingURL=useShikiHighlight-CRlVgtPy.mjs.map
