---
// 只加载基础的等宽字体，减少加载时间
import "@fontsource-variable/jetbrains-mono";

interface Props {
	class: string;
}
const className = Astro.props.class;
---
<div data-pagefind-body class={`prose dark:prose-invert prose-base !max-w-none custom-md ${className}`}>
    <slot/>
</div>

<script>
import { handleCodeCopy } from "@/utils/code-copy-utils";

document.addEventListener("click", function (e: MouseEvent) {
    const target = e.target as Element | null;
    if (target && target.classList.contains("copy-btn")) {
        handleCodeCopy(target);
    }
});
</script>
