{
/**
* When true, renders with a black background and white text instead of
* a light grey background. Defaults to false.
*/
mono?: boolean;
}
/**
* Multi-line, preformatted code sample rendered with `` so
* whitespace and indentation are preserved exactly as authored. There is no
* syntax color coding, since e-ink displays render in greyscale.
*
* @example
* ```tsx
* {`function greet(name) {\n return \`Hello, \${name}\`;\n}`}
* ```
*/
function Block({ className, children, mono = false, ...rest }: CodeBlockProps) {
return (
{children}
);
}
/**
* Inline code snippet rendered with the semantic `` element. By
* default it gets a light grey background; when `mono` is true it gets a
* black background with white text instead. For multi-line samples with
* preserved indentation, use {@link Code.Block}.
*
* @example
* ```tsx
* npm install
* npm install
* ```
*/
export function Code({ className, children, mono = false, ...rest }: CodeProps) {
return (
{children}
);
}
Code.Block = Block;