import { useState } from "preact/hooks"; import Prism from "https://esm.sh/prismjs@1.27.0"; import "https://esm.sh/prismjs@1.27.0/components/prism-typescript?no-check"; interface CodeBoxProps { code: string; } export default function CodeBox(props: CodeBoxProps) { const highlighted = Prism.highlight( props.code, Prism.languages.typescript, "typescript", ); const onCopy = () => { navigator.clipboard.writeText(props.code); setCopied(true); }; const [copied, setCopied] = useState(false); return (