import * as React from "react"; interface CodeBlockProps { children: string; size?: "sm" | "md"; } const SIZE_PADDING: Record, string> = { sm: "px-3 py-2", md: "p-3 md:p-4", }; export function CodeBlock({ children, size = "md" }: CodeBlockProps) { const [copied, setCopied] = React.useState(false); const handleCopy = React.useCallback(() => { navigator.clipboard.writeText(children); setCopied(true); setTimeout(() => setCopied(false), 2000); }, [children]); return (
$ {children}
); }