"use client";
import { Ks, Qe, R } from "./chunk-RLXIAIE6.js";
import { useContext, useEffect, useState } from "react";
import { jsx } from "react/jsx-runtime";
var L = ({ code: s, language: c, raw: l, className: u, ...d }) => {
	let { shikiTheme: f } = useContext(R), p = Ks(), [m, h] = useState(l);
	return useEffect(() => {
		if (!p) {
			h(l);
			return;
		}
		let e = p.highlight({
			code: s,
			language: c,
			themes: f
		}, (e) => {
			h(e);
		});
		e && h(e);
	}, [
		s,
		c,
		f,
		p,
		l
	]), jsx(Qe, {
		className: u,
		language: c,
		result: m,
		...d
	});
};
export { L as HighlightedCodeBlockBody };
