mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 10:55:57 +00:00
- Rename all packages from fumadocs-* to @hanzo/docs-* - Update all imports across apps, examples, and packages - Update documentation and content references - Sync lockfile with new package names
23 lines
520 B
TypeScript
23 lines
520 B
TypeScript
import * as Base from '@hanzo/docs/ui/components/codeblock';
|
|
import { highlight } from '@hanzo/docs/core/highlight';
|
|
import { type HTMLAttributes } from 'react';
|
|
|
|
export async function CodeBlock({
|
|
code,
|
|
lang,
|
|
...rest
|
|
}: HTMLAttributes<HTMLElement> & {
|
|
code: string;
|
|
lang: string;
|
|
}) {
|
|
const rendered = await highlight(code, {
|
|
lang,
|
|
components: {
|
|
pre: (props) => <Base.Pre {...props} />,
|
|
},
|
|
// other Shiki options
|
|
});
|
|
|
|
return <Base.CodeBlock {...rest}>{rendered}</Base.CodeBlock>;
|
|
}
|