Files
Hayden Bleasel 75faa2ed26 Reduce bundle size by 98%, create Streamdown CDN (#295)
* Bundle minimal languages, load excess from CDN

* Update cdn-loader.ts

* Proxy rewrite CDN urls

* Create bold-worms-enjoy.md

* Update code-blocks.mdx

* Delete unused pages

* Add new CDN unit tests

* Run Ultracite

* Manual fixes

* Update sidebar.tsx
2025-12-07 22:16:45 -08:00

32 lines
787 B
TypeScript

import type { ComponentProps } from "react";
import { cn } from "../utils";
type CodeBlockContainerProps = ComponentProps<"div"> & {
language: string;
};
export const CodeBlockContainer = ({
className,
language,
style,
...props
}: CodeBlockContainerProps) => (
<div
className={cn(
"my-4 w-full overflow-hidden rounded-xl border border-border",
className
)}
data-language={language}
data-streamdown="code-block"
style={{
// Use content-visibility to skip rendering off-screen blocks
// This can significantly improve performance for large documents
contentVisibility: "auto",
// Provide a hint for layout to prevent layout shifts
containIntrinsicSize: "auto 200px",
...style,
}}
{...props}
/>
);