mirror of
https://github.com/Snigdha-OS/documentation.git
synced 2025-09-16 20:44:56 +02:00
24 lines
811 B
JavaScript
24 lines
811 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
import React from 'react';
|
|
import clsx from 'clsx';
|
|
import Container from '@theme/CodeBlock/Container';
|
|
import styles from './styles.module.css';
|
|
// <pre> tags in markdown map to CodeBlocks. They may contain JSX children. When
|
|
// the children is not a simple string, we just return a styled block without
|
|
// actually highlighting.
|
|
export default function CodeBlockJSX({children, className}) {
|
|
return (
|
|
<Container
|
|
as="pre"
|
|
tabIndex={0}
|
|
className={clsx(styles.codeBlockStandalone, 'thin-scrollbar', className)}>
|
|
<code className={styles.codeBlockLines}>{children}</code>
|
|
</Container>
|
|
);
|
|
}
|