2026-11-16 21:58:18 +06:00
|
|
|
import { cn } from '@/lib/utils';
|
2026-10-23 19:56:38 -07:00
|
|
|
import React from 'react';
|
|
|
|
|
|
2026-11-16 21:58:18 +06:00
|
|
|
interface CodeBlockProps extends React.HTMLAttributes<HTMLPreElement> {
|
2026-10-23 19:56:38 -07:00
|
|
|
children: React.ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
2026-11-16 21:58:18 +06:00
|
|
|
export const CodeBlock: React.FC<CodeBlockProps> = ({ children, className, ...props }) => (
|
|
|
|
|
<pre
|
|
|
|
|
className={cn(
|
|
|
|
|
'overflow-x-auto bg-[var(--bg-main)] p-3 font-mono text-[11.5px] leading-relaxed text-[var(--text)]',
|
|
|
|
|
className
|
|
|
|
|
)}
|
|
|
|
|
{...props}
|
|
|
|
|
>
|
2026-10-23 19:56:38 -07:00
|
|
|
<code>{children}</code>
|
|
|
|
|
</pre>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export default CodeBlock;
|