import hljs from "highlight.js";
import { createResource, For } from "solid-js";
import "../styles/fileviewer.css";
import "../util/highlight.js/index";
export function CodeBlock(props: { code: string; language: string }) {
const [codeBlock] = createResource(
() => props,
(props) => {
const highlit = hljs.getLanguage(props.language)
? hljs.highlight(props.code, { language: props.language }).value
: props.code;
return (
{codeBlock()}
);
}