/** * 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, {type ComponentProps, type ReactNode} from 'react'; import clsx from 'clsx'; import {useCodeBlockContext} from '@docusaurus/theme-common/internal'; import {usePrismTheme} from '@docusaurus/theme-common'; import {Highlight} from 'prism-react-renderer'; import type {Props} from '@theme/CodeBlock/Content'; import Line from '@theme/CodeBlock/Line'; import styles from './styles.module.css'; // TODO Docusaurus v4: remove useless forwardRef const Pre = React.forwardRef>( (props, ref) => { return (
    );
  },
);

function Code(props: ComponentProps<'code'>) {
  const {metadata} = useCodeBlockContext();
  return (
    
  );
}

export default function CodeBlockContent({
  className: classNameProp,
}: Props): ReactNode {
  const {metadata, wordWrap} = useCodeBlockContext();
  const prismTheme = usePrismTheme();
  const {code, language, lineNumbersStart, lineClassNames} = metadata;
  return (
    
      {({className, style, tokens: lines, getLineProps, getTokenProps}) => (
        
          
            {lines.map((line, i) => (
              
            ))}
          
        
)}
); }